/* BeanNest apex portal (beannest.net): light, image-first brand home + reading pages.
   Loaded alone on the apex home/articles, and after style.css on older apex pages
   (guides hub, policies) where body.apex re-themes the shared dark tokens. */
body.apex {
  --bg: #fbf7ef;
  --bg-raised: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3ece0;
  --border: #e6dccb;
  --text: #1f2430;
  --text-dim: #5b6172;
  --primary: #2f5bd3;
  --accent: #c2410c;
  --focus: #2f5bd3;
  --apex-ink: #1f2430;
  --apex-dim: #5b6172;
  --apex-line: #e6dccb;
  --apex-card: #ffffff;
  --apex-brand: #2f5bd3;
  --apex-warm: #f59e0b;
  --apex-radius: 16px;
  margin: 0;
  color: var(--apex-ink);
  background: #fbf7ef;
  font: 400 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body.apex * { box-sizing: border-box; }
body.apex a { color: var(--apex-brand); text-decoration: none; }
body.apex a:hover { text-decoration: underline; color: var(--apex-brand); }
body.apex :focus-visible { outline: 3px solid var(--apex-brand); outline-offset: 2px; border-radius: 6px; }
body.apex h1, body.apex h2, body.apex h3 { font-family: inherit; color: var(--apex-ink); letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
body.apex p { margin-top: 0; margin-bottom: 0; }
body.apex img { display: block; max-width: 100%; height: auto; }
.apex .skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 16px; background: #fff; color: var(--apex-ink); border-radius: 10px; }
.apex .skip-link:focus { top: 12px; }

.apex-wrap { width: min(100% - 32px, 1180px); margin-inline: auto; }

/* Header + footer */
.apex-header { position: sticky; top: 0; z-index: 20; background: rgba(251, 247, 239, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--apex-line); }
.apex-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.apex-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--apex-ink) !important; text-decoration: none !important; }
.apex-brand img { width: 40px; height: auto; }
.apex-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.apex-nav a { padding: 10px 14px; border-radius: 999px; color: var(--apex-ink) !important; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.apex-nav a:hover { background: #f1e8d8; text-decoration: none !important; }
.apex-footer { margin-top: 56px; padding: 28px 0 40px; border-top: 1px solid var(--apex-line); color: var(--apex-dim); font-size: 0.92rem; }
.apex-footer .apex-wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.apex-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.apex-footer a { color: var(--apex-dim) !important; }

/* Hero */
.apex-hero { padding: 44px 0 20px; text-align: center; }
.apex-hero h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); font-weight: 800; }
.apex-hero p { margin: 12px auto 0; max-width: 560px; color: var(--apex-dim); font-size: 1.1rem; }
.apex-hero-actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.apex-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border-radius: 999px; font-weight: 700; border: 1.5px solid var(--apex-line); background: #fff; color: var(--apex-ink) !important; }
.apex-btn:hover { text-decoration: none !important; border-color: var(--apex-ink); }
.apex-btn-primary { background: var(--apex-brand); border-color: var(--apex-brand); color: #fff !important; }
.apex-btn-primary:hover { background: #2549ad; border-color: #2549ad; }

/* Sections */
.apex-section { padding: 28px 0; }
.apex-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.apex-section-head h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); font-weight: 800; }
.apex-section-head a { font-weight: 700; white-space: nowrap; }
.apex-subhead { font-size: 1rem; margin: 22px 0 10px !important; color: var(--apex-dim) !important; font-weight: 700; }
.apex-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.apex-chips a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1px solid var(--apex-line); color: var(--apex-ink) !important; font-weight: 600; font-size: 0.95rem; }
.apex-chips a:hover { border-color: var(--apex-ink); text-decoration: none !important; }

/* Game tiles: image first, name only */
.game-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.game-tile { position: relative; display: block; overflow: hidden; border-radius: var(--apex-radius); background: #1a1f33; box-shadow: 0 1px 2px rgba(31, 36, 48, 0.08), 0 8px 20px rgba(31, 36, 48, 0.08); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.game-tile img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.game-tile-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; color: #fff; font-weight: 700; font-size: 0.98rem; background: linear-gradient(to top, rgba(10, 12, 22, 0.88), transparent); }
.game-tile:hover, .game-tile:focus-visible { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(31, 36, 48, 0.18); text-decoration: none !important; }

/* Tool tiles: icon + two short lines */
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tool-grid-compact { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tool-tile { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 14px; border-radius: 14px; background: var(--apex-card); border: 1px solid var(--apex-line); color: var(--apex-ink) !important; transition: border-color 0.15s ease, transform 0.15s ease; }
.tool-tile:hover, .tool-tile:focus-visible { border-color: var(--apex-brand); transform: translateY(-2px); text-decoration: none !important; }
.tool-tile-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #f3ece0; font-size: 1.4rem; }
.tool-tile-text { display: grid; min-width: 0; }
.tool-tile-text strong { font-size: 0.98rem; }
.tool-tile-text span { color: var(--apex-dim); font-size: 0.86rem; }

/* Article cards */
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.article-card { display: grid; grid-template-rows: auto 1fr; overflow: hidden; border-radius: var(--apex-radius); background: var(--apex-card); border: 1px solid var(--apex-line); color: var(--apex-ink) !important; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.article-card:hover, .article-card:focus-visible { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(31, 36, 48, 0.12); text-decoration: none !important; }
.article-card-media { display: grid; place-items: center; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #e8eefc, #fdf0dc); overflow: hidden; }
.article-card-media img { width: 100%; height: 100%; object-fit: cover; }
.article-card-icon { font-size: 3rem; }
.article-card-body { display: grid; align-content: start; gap: 6px; padding: 14px 16px 16px; }
.article-card-eyebrow { color: var(--accent); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.article-card-body strong { font-size: 1.05rem; line-height: 1.3; }
.article-card-meta { color: var(--apex-dim); font-size: 0.85rem; }

/* About strip */
.apex-about-inner { display: flex; gap: 24px; align-items: center; padding: 24px; border-radius: 20px; background: #fff; border: 1px solid var(--apex-line); }
.apex-about-inner img { width: 88px; flex: none; }
.apex-about h2 { font-size: 1.3rem; margin-bottom: 8px; }
.apex-about p { color: var(--apex-dim); }
.apex-about-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px !important; }
.apex-about-links a { font-weight: 700; }

/* Article page */
.apex-article-layout { padding-top: 20px; }
.apex-crumb { font-size: 0.9rem; color: var(--apex-dim); margin-bottom: 14px; }
.apex-article { max-width: 760px; margin-inline: auto; }
.apex-eyebrow { color: var(--accent); font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }
.apex-article h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; margin-top: 6px; }
.apex-article-byline { margin-top: 10px !important; color: var(--apex-dim); font-size: 0.92rem; }
.apex-article-hero { margin-top: 20px; border-radius: var(--apex-radius); overflow: hidden; }
.apex-article-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.apex-article-lede { margin-top: 20px !important; font-size: 1.15rem; color: #2c3240; }
.apex-article section { margin-top: 30px; }
.apex-article h2 { font-size: 1.45rem; font-weight: 800; margin-bottom: 10px; }
.apex-article p + p { margin-top: 12px; }
.apex-article ul, .apex-article ol { margin: 12px 0 0; padding-left: 1.4em; }
.apex-article li + li { margin-top: 6px; }
.apex-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; padding: 18px; border-radius: var(--apex-radius); background: #eef2fd; border: 1px solid #d5def8; align-items: center; }
.apex-cta strong { margin-right: auto; }
.article-faq details { border-top: 1px solid var(--apex-line); padding: 14px 0; }
.article-faq details:last-child { border-bottom: 1px solid var(--apex-line); }
.article-faq summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.article-faq details p { margin-top: 8px; color: #2c3240; }
.apex-related { max-width: 1180px; margin: 44px auto 0; }
.apex-related h2 { font-size: 1.35rem; margin-bottom: 14px; }

/* Older apex pages (guides hub, policies) rendered with style.css underneath. */
body.apex .portal-layout { width: min(100% - 32px, 1180px); }
body.apex .card, body.apex .guide-teaser, body.apex .product-family-card { background: #fff; border-color: var(--apex-line); color: var(--apex-ink); box-shadow: none; }
body.apex .block, body.apex .page-heading, body.apex .guide-article section { background: transparent; border-color: var(--apex-line); color: var(--apex-ink); box-shadow: none; }
body.apex .legal-page h1, body.apex .page-heading h1, body.apex .guide-heading h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; }
body.apex .legal-page h2 { margin-top: 26px; margin-bottom: 6px; }
body.apex .legal-page p, body.apex .legal-page li { color: #2c3240; }
body.apex .guide-section { margin-top: 28px; }
body.apex .guide-section h2 { margin-bottom: 12px; }
body.apex .eyebrow { color: var(--accent); }
body.apex .breadcrumb, body.apex .breadcrumb a { color: var(--apex-dim); }

@media (max-width: 960px) {
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-grid, .tool-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .apex-header-inner { min-height: 56px; }
  .apex-brand span { display: none; }
  .apex-nav a { padding: 8px 10px; font-size: 0.95rem; }
  .apex-hero { padding: 28px 0 8px; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .game-tile-name { font-size: 0.86rem; padding: 20px 8px 7px; }
  .tool-grid, .tool-grid-compact { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tool-tile { padding: 10px; gap: 8px; min-height: 64px; }
  .tool-tile-icon { width: 36px; height: 36px; font-size: 1.15rem; }
  .tool-tile-text span { display: none; }
  .article-grid { grid-template-columns: 1fr; }
  .apex-about-inner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .game-tile, .tool-tile, .article-card { transition: none; }
}
@media (max-width: 600px) {
  .article-grid .article-card { grid-template-columns: 112px 1fr; grid-template-rows: none; }
  .article-grid .article-card-media { aspect-ratio: auto; height: 100%; min-height: 84px; }
  .article-card-icon { font-size: 2rem; }
  .article-card-body { padding: 10px 12px; }
  .article-card-body strong { font-size: 0.95rem; }
}
@media (max-width: 600px) {
  .apex-hero { padding: 18px 0 4px; }
  .apex-hero h1 { font-size: 1.6rem; }
  .apex-hero p { font-size: 0.98rem; margin-top: 8px; }
  .apex-hero-actions { margin-top: 14px; gap: 8px; }
  .apex-btn { min-height: 44px; padding: 0 18px; }
  .apex-section { padding: 18px 0; }
  .apex-section-head { margin-bottom: 10px; }
  .apex-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .apex-chips a { flex: none; }
}
