/* Public home page: one screen, no scroll. Rolling headline + soft app-style cards over a light 3D intersection.
 * Desktop: the scene owns the left side, the copy + cards stack in a clean column on the right (same layout as mobile).
 * Light and dark themes are both designed.
 * Performance: only the small canvas scene and two short text rolls animate; no backdrop-filter. */

/* ---------- theme tokens ---------- */
.hx-shell {
  --hx-amber: #f5b544;
  --hx-ink: #0b2e3b;
  --hx-ink-soft: #3d5a66;
  --hx-title: #1c4fb5;
  --hx-card: #ffffff;
  --hx-card-edge: rgba(255, 255, 255, 0.9);
  --hx-shadow: 0 10px 26px rgba(20, 70, 90, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --hx-glass: rgba(255, 255, 255, 0.72);
  --hx-glass-edge: rgba(11, 46, 59, 0.16);
  --hx-glass-ink: #0b2e3b;
  --hx-sub: #5a6578;
  --hx-icon-label: #0b2e3b;
  --hx-scrim: rgba(220, 236, 240, 0.92);
  --hx-bg: linear-gradient(180deg, #d4eaf0 0%, #dcecf0 40%, #e9f3f5 100%);
  --hx-glow: rgba(79, 195, 184, 0.35);
}
[data-theme="dark"] .hx-shell {
  --hx-ink: #ffffff;
  --hx-ink-soft: rgba(255, 255, 255, 0.78);
  --hx-title: #9cc3f5;
  --hx-card: rgba(15, 56, 68, 0.94);
  --hx-card-edge: rgba(255, 255, 255, 0.2);
  --hx-shadow: 0 10px 26px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --hx-glass: rgba(255, 255, 255, 0.09);
  --hx-glass-edge: rgba(255, 255, 255, 0.26);
  --hx-glass-ink: #ffffff;
  --hx-sub: rgba(255, 255, 255, 0.66);
  --hx-icon-label: #ffffff;
  --hx-scrim: rgba(6, 32, 43, 0.9);
  --hx-bg: linear-gradient(180deg, #0d3a47 0%, #0a2d38 40%, #06202b 100%);
  --hx-glow: rgba(79, 195, 184, 0.4);
}

.hx-shell {
  position: relative; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  background: radial-gradient(55% 45% at 85% 0%, var(--hx-glow), transparent 70%), var(--hx-bg);
  color: var(--hx-ink);
}
#hx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 0.8s ease; }
#hx-canvas.is-on { opacity: 1; }
/* soft wash on the side where the UI column sits, so text never fights the scene */
.hx-scrim { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(to left, var(--hx-scrim) 0%, var(--hx-scrim) 30%, transparent 62%); }
.hx-shell > header, .hx-shell > main { position: relative; z-index: 1; }
.hx-shell > header { z-index: 70; }

/* header: flat on the scene */
.hx-shell .landing-header { background: transparent; border-bottom: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.hx-shell .landing-brand .sidebar-brand-name,
.hx-shell .landing-nav-link { color: var(--hx-ink); }
.hx-shell .icon-btn { color: var(--hx-ink); background: var(--hx-glass); border-color: var(--hx-glass-edge); }


/* ---------- layout (desktop): UI column on the right (inline-start), scene free on the left ---------- */
.hx-hero {
  flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 8px 40px 36px;
  display: grid; grid-template-columns: minmax(420px, 540px) 1fr; grid-template-rows: auto auto; align-content: center; gap: 26px 40px;
}
.hx-copy { grid-column: 1; grid-row: 1; align-self: end; width: 100%; }

/* rolling text (shared by headline and chip) */
.hx-roll { transition: opacity 0.38s ease, transform 0.38s ease; }
.hx-roll.is-out { opacity: 0; transform: translateY(-45%); }
.hx-roll.is-in { opacity: 0; transform: translateY(45%); transition: none; }

.hx-copy h1 {
  font-size: clamp(32px, 3.5vw, 54px); font-weight: 800; line-height: 1.4; letter-spacing: -0.01em; text-wrap: balance;
  color: var(--hx-ink); margin: 0 0 24px; min-height: 2.8em; max-width: 540px;
}
.hx-actions { display: flex; gap: 12px; }
.hx-actions .hx-btn { flex: 1; justify-content: space-between; padding-inline: 20px; }
.hx-btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 28px; border-radius: 16px; font-size: 15.5px; font-weight: 700; text-decoration: none; transition: transform 0.15s ease; }
.hx-btn:hover { transform: translateY(-2px); }
.hx-btn-accent { background: var(--hx-amber); color: #2a1c00; box-shadow: 0 10px 24px rgba(245, 181, 68, 0.32); }
.hx-btn-accent:hover { color: #2a1c00; }
.hx-btn-glass { background: var(--hx-glass); border: 1px solid var(--hx-glass-edge); color: var(--hx-glass-ink); }
.hx-btn-glass:hover { color: var(--hx-glass-ink); }

.hx-chip {
  display: none; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 18px; border-radius: 999px;
  background: var(--hx-glass); border: 1px solid var(--hx-glass-edge); color: var(--hx-glass-ink);
  font-size: 13.5px; font-weight: 700; overflow: hidden; min-width: 340px;
}
.hx-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--hx-amber); flex: none; }
.hx-chip .hx-roll { display: inline-block; }


/* ---------- cards: compact stack under the copy ---------- */
.hx-cards { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto; gap: 12px; width: 100%; }
.hx-tile {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--hx-title);
  background: var(--hx-card); border: 1px solid var(--hx-card-edge); box-shadow: var(--hx-shadow); border-radius: 20px;
  transition: transform 0.15s ease;
}
.hx-tile:hover { transform: translateY(-2px); }
.hx-tile strong { font-weight: 800; }
.hx-go { margin-inline-start: auto; width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--hx-amber); color: #2a1c00; }
.hx-tile-lg { grid-column: 1 / -1; grid-row: 1; padding: 14px 16px; }
.hx-glyph { width: 42px; height: 42px; flex: none; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--hx-amber) 20%, transparent); }
.hx-glyph svg { width: 22px; height: 22px; fill: none; stroke: var(--hx-amber); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hx-tile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hx-tile-text strong { font-size: 18px; line-height: 1.5; }
.hx-tile-text small { font-size: 12.5px; color: var(--hx-sub); }
.hx-tile-sm { padding: 12px 16px; font-size: 15.5px; }
.hx-s1 { grid-column: 1; grid-row: 2; } .hx-s2 { grid-column: 2; grid-row: 2; }

.hx-icons { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hx-icon {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px 4px 12px;
  text-decoration: none; color: var(--hx-icon-label); font-weight: 700; font-size: 12.5px; white-space: nowrap;
  background: var(--hx-card); border: 1px solid var(--hx-card-edge); box-shadow: var(--hx-shadow); border-radius: 20px; transition: transform 0.15s ease;
}
.hx-icon:hover { transform: translateY(-2px); }
.hx-icon i { display: grid; place-items: center; }
.hx-icon svg { width: 28px; height: 28px; fill: none; stroke: var(--hx-amber); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* short desktop windows: tighten so everything still fits one screen */
@media (min-width: 821px) and (max-height: 820px) {
  .hx-copy h1 { font-size: clamp(26px, 2.8vw, 38px); margin-bottom: 14px; }
  .hx-hero { gap: 16px 40px; }
  .hx-icon { padding: 10px 4px 9px; }
  .hx-icon svg { width: 24px; height: 24px; }
  .hx-tile-lg { padding: 10px 14px; }
  .hx-tile-sm { padding: 11px 14px; }
}

/* ---------- mobile: rolling headline, buttons, chip / scene band / compact cards ---------- */
@media (max-width: 820px) {
  .hx-scrim { background: linear-gradient(to bottom, var(--hx-scrim) 0%, var(--hx-scrim) 30%, transparent 50%, transparent 66%, var(--hx-scrim) 100%); }
  .hx-hero { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; align-content: normal; padding: 2px 16px 16px; gap: 6px; text-align: center; }
  .hx-copy { grid-row: 1; align-self: start; }
  .hx-copy h1 { font-size: 27px; line-height: 1.45; margin: 4px auto 14px; min-height: 2.9em; max-width: 340px; }
  .hx-actions { justify-content: center; gap: 10px; }
  .hx-btn { padding: 11px 18px; font-size: 14px; }
  .hx-chip { margin-top: 14px; min-width: 0; width: 100%; max-width: 340px; justify-content: center; font-size: 12.5px; padding: 9px 14px; }

  .hx-cards { grid-row: 3; gap: 10px; max-width: 420px; margin: 0 auto; text-align: start; }
  .hx-tile { border-radius: 18px; }
  .hx-tile-lg { padding: 11px 14px; }
  .hx-glyph { width: 38px; height: 38px; border-radius: 12px; }
  .hx-glyph svg { width: 20px; height: 20px; }
  .hx-tile-text strong { font-size: 15.5px; }
  .hx-tile-sm { padding: 12px 14px; font-size: 14px; }
  .hx-icons { gap: 8px; }
  .hx-icon { font-size: 11px; gap: 6px; padding: 10px 2px 9px; border-radius: 16px; }
  .hx-icon svg { width: 24px; height: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  #hx-canvas, .hx-roll { transition: none; }
  .hx-tile, .hx-icon, .hx-btn { transition: none; }
}

/* ---------- hamburger button + menu panel, in the same language as the cards ---------- */
.hx-shell .landing-mobile-toggle { width: 42px; height: 42px; border-radius: 14px; color: var(--hx-ink); background: var(--hx-glass); border: 1px solid var(--hx-glass-edge); box-shadow: var(--hx-shadow); }
.hx-shell .landing-mobile-toggle svg { width: 20px; height: 20px; }
.hx-shell .landing-nav-actions .btn-primary { border-radius: 14px; }
.hx-shell .theme-toggle-track { box-shadow: var(--hx-shadow); }

.hx-shell .hx-menu {
  position: fixed; z-index: 60; top: calc(var(--header-h, 64px) + 6px); inset-inline: 12px;
  padding: 10px; border-radius: 24px; background: #ffffff; border: 1px solid var(--hx-card-edge); box-shadow: 0 24px 50px rgba(8, 30, 40, 0.35);
  max-height: calc(100svh - var(--header-h, 64px) - 20px); overflow-y: auto;
}
.hx-shell .hx-menu.is-open { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; animation: hx-menu-in 0.2s ease-out; }
@keyframes hx-menu-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.hx-menu-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 16px; text-decoration: none;
  color: var(--hx-title); font-weight: 800; font-size: 13.5px; background: color-mix(in srgb, var(--hx-amber) 8%, transparent);
  border: 1px solid transparent; transition: background 0.15s ease;
}
.hx-menu-link:hover { background: color-mix(in srgb, var(--hx-amber) 18%, transparent); color: var(--hx-title); }
.hx-menu-link .hx-glyph { width: 34px; height: 34px; border-radius: 11px; }
.hx-menu-link .hx-glyph svg { width: 18px; height: 18px; }
.hx-menu-cta { grid-column: 1 / -1; text-align: center; padding: 13px; border-radius: 16px; background: var(--hx-amber); color: #2a1c00; font-weight: 800; font-size: 14.5px; text-decoration: none; box-shadow: 0 8px 20px rgba(245, 181, 68, 0.3); }
.hx-menu-cta:hover { color: #2a1c00; }
@media (min-width: 861px) { .hx-shell .hx-menu { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .hx-shell .hx-menu.is-open { animation: none; } }

[data-theme="dark"] .hx-shell .hx-menu { background: #0e3340; }
/* narrow phones: the small cards have no room for an arrow chip next to icon + label */
@media (max-width: 820px) { .hx-tile-sm .hx-go { display: none; } }

html[data-hx-no3d] .hx-chip { display: flex; width: 100%; margin: 18px 0 0; }

/* headline: ONE line, no wrapping. The font scales with the column so the longest phrase always fits. */
.hx-copy { container-type: inline-size; }
.hx-copy h1 {
  white-space: nowrap; text-wrap: nowrap; max-width: none; min-height: 0; line-height: 1.6; margin: 0 0 22px;
  font-size: 22px;
  font-size: min(44px, calc(100cqw / 16.4));
}
