/* Morph Hub — static dark landing styles (no external assets) */

:root {
  --bg: #070b16;
  --surface: #0d1324;
  --surface-hover: #111a31;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f5f7ff;
  --text-secondary: #c8d2ea;
  --text-muted: #9aa8c7;
  --focus-default: #7c5cff;
  --radius-card: 20px;
  --radius-inner: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 36rem at 15% -10%, rgba(124, 92, 255, 0.14), transparent 60%),
    radial-gradient(55rem 36rem at 85% 0%, rgba(26, 163, 255, 0.12), transparent 60%),
    radial-gradient(48rem 32rem at 50% 105%, rgba(124, 92, 255, 0.08), transparent 65%);
}

.hub {
  width: 100%;
  max-width: 980px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 24px 36px;
  display: flex;
  flex-direction: column;
}

/* Header & language toggle */
.hub-header {
  margin-bottom: 36px;
}

.hub-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}

.hub-brand {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.lang-toggle {
  min-height: 44px;
  min-width: 84px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.lang-toggle:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.lang-toggle:focus-visible {
  outline: 3px solid var(--focus-default);
  outline-offset: 3px;
}

.lang-toggle__opt.is-active {
  color: var(--text);
}

.lang-toggle__sep {
  opacity: 0.45;
}

.hub-intro {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.hub-headline {
  margin: 0 0 12px;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}

.hub-subline {
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.125rem);
  color: var(--text-secondary);
}

/* Auto-fitting apps grid: 2 equal columns on desktop, 1 on mobile (<=700px), 3+ wraps */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px;
  flex: 1 0 auto;
  align-items: stretch;
}

/* Whole-card link */
.app-card {
  --accent: #7c5cff;
  --accent-rgb: 124, 92, 255;

  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    background-color 220ms ease;
}

.app-card:hover {
  transform: translateY(-4px);
  background-color: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(var(--accent-rgb), 0.25),
    0 10px 36px rgba(var(--accent-rgb), 0.22);
}

.app-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-color: rgba(var(--accent-rgb), 0.7);
}

/* Dark accent-tinted logo stage for white-on-transparent logos */
.app-card__media {
  height: 188px;
  padding: 24px;
  margin-bottom: 22px;
  border-radius: var(--radius-inner);
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  background:
    radial-gradient(circle at 50% 45%, rgba(var(--accent-rgb), 0.26), rgba(var(--accent-rgb), 0.07) 58%, rgba(7, 11, 22, 0.92) 100%),
    #080d1b;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.app-card__logo {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 140px;
  object-fit: contain;
  object-position: center;
}

.app-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.app-card__name {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.app-card__tagline {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.app-card__desc {
  margin: 4px 0 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.app-card__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* High-contrast CTA pill on dark accent tint */
.app-card__cta {
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--text);
  font-size: 0.975rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background-color 200ms ease, border-color 200ms ease;
}

.app-card:hover .app-card__cta {
  background: rgba(var(--accent-rgb), 0.3);
  border-color: rgba(var(--accent-rgb), 0.85);
}

.app-card__arrow {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  transition: transform 200ms ease;
}

[dir="rtl"] .app-card__arrow {
  transform: scaleX(-1);
}

.app-card:hover .app-card__arrow {
  transform: translateX(3px);
}

[dir="rtl"] .app-card:hover .app-card__arrow {
  transform: scaleX(-1) translateX(3px);
}

.app-card__note {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Noscript fallback */
.noscript-fallback {
  margin: 24px auto;
  padding: 24px;
  max-width: 520px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}

.noscript-fallback p {
  margin: 0 0 16px;
  color: var(--text-secondary);
}

.noscript-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.noscript-links a {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.noscript-links a:focus-visible {
  outline: 3px solid var(--focus-default);
  outline-offset: 3px;
}

/* Footer */
.hub-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.hub-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Mobile layout */
@media (max-width: 700px) {
  .hub {
    padding: 20px 16px 28px;
  }

  .hub-topbar {
    margin-bottom: 24px;
  }

  .hub-header {
    margin-bottom: 28px;
  }

  .apps-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .app-card {
    padding: 16px;
  }

  .app-card__media {
    height: 160px;
    padding: 20px;
    margin-bottom: 18px;
  }

  .app-card__logo {
    max-height: 120px;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .lang-toggle,
  .app-card,
  .app-card__cta,
  .app-card__arrow {
    transition: none;
  }

  .app-card:hover {
    transform: none;
  }

  .app-card:hover .app-card__arrow {
    transform: none;
  }

  [dir="rtl"] .app-card:hover .app-card__arrow {
    transform: scaleX(-1);
  }
}

/* Keep the call-to-action buttons level across side-by-side cards whatever the note length */
@media (min-width: 701px) {
  .app-card__note { min-height: 4.4em; box-sizing: content-box; }
}
