/**
 * Edenware — homepage stylesheet.
 *
 * Sits on top of /edenware-theme.css and uses only its tokens (--ew-*), so the page
 * follows the global theme toggle and the light/dark switch without a second palette.
 * Everything here is scoped under .ew-home so it cannot leak into the shell.
 *
 * Mobile-first: the base rules are the phone layout, the media queries widen it.
 */

/* ══════════════════════════════════════════════════════════════════
   PAGE FRAME
   ══════════════════════════════════════════════════════════════════ */

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--ew-bg);
  color: var(--ew-text);
  font-family: var(--ew-font);
}

.ew-home {
  font-family: var(--ew-font);
  color: var(--ew-text);
  background: var(--ew-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.ew-home *,
.ew-home *::before,
.ew-home *::after {
  box-sizing: border-box;
}

.ew-home .ew-wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.ew-home section {
  padding: 56px 0;
}

.ew-home h1,
.ew-home h2,
.ew-home h3 {
  line-height: 1.2;
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ew-home h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
}

.ew-home h3 {
  font-size: 1.15rem;
}

.ew-home p {
  margin: 0 0 14px;
  color: var(--ew-text-secondary);
}

.ew-home a {
  color: var(--ew-primary-light);
}

/* Buttons carry their own foreground; the link colour above must not win. */
.ew-home a.ew-btn-primary,
.ew-home a.ew-btn-secondary,
.ew-home a.ew-btn-danger {
  color: #fff;
}

.ew-home a.ew-btn-outline {
  color: var(--ew-primary);
}

.ew-home .ew-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ew-secondary);
  margin-bottom: 10px;
}

.ew-home .ew-section-head {
  max-width: 720px;
  margin-bottom: 32px;
}

.ew-home .ew-section-head p {
  font-size: 1.02rem;
}

/* ══════════════════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════════════════ */

.ew-home .ew-hero {
  padding: 48px 0 40px;
  background:
    radial-gradient(900px 420px at 12% -10%, var(--ew-primary-bg), transparent 70%),
    radial-gradient(700px 380px at 92% 8%, var(--ew-secondary-bg), transparent 70%);
  border-bottom: 1px solid var(--ew-border);
}

.ew-home .ew-hero h1 {
  font-size: clamp(1.9rem, 1.3rem + 3vw, 3.1rem);
  margin-bottom: 16px;
}

.ew-home .ew-hero .ew-lede {
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.18rem);
  max-width: 62ch;
  color: var(--ew-text-secondary);
}

.ew-home .ew-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 18px;
}

.ew-home .ew-hero-actions .ew-btn {
  flex: 1 1 100%;
  justify-content: center;
}

.ew-home .ew-hero-note {
  font-size: 0.86rem;
  color: var(--ew-text-muted);
  margin: 0;
}

/* Trust strip — the verifiable numbers, right under the hero. */
.ew-home .ew-trust {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 32px;
  background: var(--ew-border);
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius-lg);
  overflow: hidden;
}

.ew-home .ew-trust-item {
  background: var(--ew-surface);
  padding: 16px 18px;
}

.ew-home .ew-trust-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ew-text);
  line-height: 1.1;
}

.ew-home .ew-trust-label {
  display: block;
  font-size: 0.8rem;
  color: var(--ew-text-muted);
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════════
   APP CARDS
   ══════════════════════════════════════════════════════════════════ */

.ew-home .ew-apps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.ew-home .ew-app {
  display: flex;
  flex-direction: column;
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius-lg);
  overflow: hidden;
  transition: border-color var(--ew-transition), transform var(--ew-transition);
}

.ew-home .ew-app:hover {
  border-color: var(--ew-primary);
}

.ew-home .ew-app-media {
  aspect-ratio: 16 / 9;
  background: var(--ew-surface-2);
  border-bottom: 1px solid var(--ew-border);
  overflow: hidden;
}

.ew-home .ew-app-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ew-home .ew-app-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ew-home .ew-app-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ew-home .ew-app-head img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex: none;
}

.ew-home .ew-app-head h3 {
  margin: 0;
}

.ew-home .ew-app-tagline {
  font-weight: 600;
  color: var(--ew-text);
  margin-bottom: 8px;
}

.ew-home .ew-app-body > p {
  font-size: 0.94rem;
}

.ew-home .ew-app-facts {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ew-home .ew-app-facts li {
  font-size: 0.76rem;
  color: var(--ew-text-secondary);
  background: var(--ew-surface-2);
  border: 1px solid var(--ew-border);
  border-radius: 999px;
  padding: 3px 10px;
}

.ew-home .ew-app-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ew-home .ew-app-actions .ew-btn {
  flex: 1 1 auto;
  justify-content: center;
}

.ew-home .ew-app-repo {
  font-size: 0.82rem;
  color: var(--ew-text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.ew-home .ew-app-repo:hover {
  color: var(--ew-text);
}

/* ══════════════════════════════════════════════════════════════════
   OPEN SOURCE ("good karma")
   ══════════════════════════════════════════════════════════════════ */

.ew-home .ew-oss {
  background: var(--ew-surface-2);
  border-top: 1px solid var(--ew-border);
  border-bottom: 1px solid var(--ew-border);
}

.ew-home .ew-oss-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 8px;
}

.ew-home .ew-oss-card {
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius-lg);
  padding: 18px;
}

.ew-home .ew-oss-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.ew-home .ew-oss-card p {
  font-size: 0.9rem;
  margin: 0;
}

.ew-home .ew-oss-cta {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ew-home .ew-oss-cta .ew-btn {
  flex: 1 1 100%;
  justify-content: center;
}

/* ══════════════════════════════════════════════════════════════════
   PARTNERSHIP HUB
   ══════════════════════════════════════════════════════════════════ */

.ew-home .ew-hub-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.ew-home .ew-hub-stat {
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius);
  padding: 14px 12px;
  text-align: center;
}

.ew-home .ew-hub-stat strong {
  display: block;
  font-size: 1.35rem;
  color: var(--ew-secondary);
  line-height: 1.1;
}

.ew-home .ew-hub-stat span {
  display: block;
  font-size: 0.76rem;
  color: var(--ew-text-muted);
  margin-top: 4px;
}

.ew-home .ew-hub-steps {
  list-style: none;
  counter-reset: ew-step;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.ew-home .ew-hub-steps li {
  counter-increment: ew-step;
  position: relative;
  padding-left: 44px;
  font-size: 0.94rem;
  color: var(--ew-text-secondary);
}

.ew-home .ew-hub-steps li::before {
  content: counter(ew-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ew-primary-bg);
  border: 1px solid var(--ew-primary);
  color: var(--ew-primary-light);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ew-home .ew-hub-steps strong {
  color: var(--ew-text);
}

/* ══════════════════════════════════════════════════════════════════
   FAQ
   ══════════════════════════════════════════════════════════════════ */

.ew-home .ew-faq {
  display: grid;
  gap: 10px;
}

.ew-home .ew-faq details {
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius);
  padding: 0 18px;
}

.ew-home .ew-faq details[open] {
  border-color: var(--ew-primary);
}

.ew-home .ew-faq summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  color: var(--ew-text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ew-home .ew-faq summary::-webkit-details-marker {
  display: none;
}

.ew-home .ew-faq summary::after {
  content: "+";
  font-size: 1.3rem;
  line-height: 1;
  color: var(--ew-primary-light);
  flex: none;
}

.ew-home .ew-faq details[open] summary::after {
  content: "\2212";
}

.ew-home .ew-faq details p {
  margin: 0 0 16px;
  font-size: 0.94rem;
}

/* ══════════════════════════════════════════════════════════════════
   FINAL CTA
   ══════════════════════════════════════════════════════════════════ */

.ew-home .ew-final {
  text-align: center;
  background: var(--ew-primary-gradient);
  color: #fff;
  border-radius: var(--ew-radius-lg);
  padding: 40px 24px;
}

.ew-home .ew-final h2 {
  color: #fff;
}

.ew-home .ew-final p {
  color: rgba(255, 255, 255, 0.86);
  max-width: 56ch;
  margin: 0 auto 22px;
}

.ew-home .ew-final .ew-btn {
  flex: 1 1 100%;
  justify-content: center;
}

.ew-home .ew-final-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ══════════════════════════════════════════════════════════════════
   STICKY DOWNLOAD BAR (mobile)
   ══════════════════════════════════════════════════════════════════ */

.ew-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--ew-surface);
  border-top: 1px solid var(--ew-border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.18);
  transform: translateY(110%);
  transition: transform 0.2s ease;
}

.ew-sticky[data-visible="true"] {
  transform: translateY(0);
}

.ew-sticky-text {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--ew-text-secondary);
}

.ew-sticky-text strong {
  display: block;
  color: var(--ew-text);
  font-size: 0.9rem;
}

.ew-sticky .ew-btn {
  flex: none;
}

/* ══════════════════════════════════════════════════════════════════
   WIDER SCREENS
   ══════════════════════════════════════════════════════════════════ */

@media (min-width: 640px) {
  .ew-home section {
    padding: 72px 0;
  }

  .ew-home .ew-hero {
    padding: 72px 0 56px;
  }

  .ew-home .ew-hero-actions .ew-btn,
  .ew-home .ew-oss-cta .ew-btn,
  .ew-home .ew-final .ew-btn {
    flex: 0 0 auto;
  }

  .ew-home .ew-trust {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ew-home .ew-oss-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ew-home .ew-hub-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .ew-home .ew-apps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ew-home .ew-app-actions .ew-btn {
    flex: 0 0 auto;
  }

  .ew-sticky {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ══════════════════════════════════════════════════════════════════ */

.ew-home :focus-visible {
  outline: 2px solid var(--ew-primary-light);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .ew-home *,
  .ew-home *::before,
  .ew-home *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
