/* ============================================
   EDHOM.CAT — Minimalist Download Portal
   Colors: edhom.cat palette (orange/dark)
   Font: Source Sans Pro
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

:root {
  /* edhom.cat palette */
  --orange-50:  #fff8f0;
  --orange-100: #ffedd5;
  --orange-200: #fddcab;
  --orange-300: #ecaf53;
  --orange-400: #f5a623;
  --orange-500: #ff9900;
  --orange-600: #e68a00;
  --orange-700: #cc7a00;
  --orange-800: #a26100;
  --orange-900: #7a4900;

  /* Dark tones from edhom.cat */
  --dark-100:   #59626d;
  --dark-200:   #484c54;
  --dark-300:   #2c343d;
  --dark-400:   #1a1f25;
  --dark-500:   #111519;

  /* Neutrals */
  --white:     #ffffff;
  --gray-50:   #fafafa;
  --gray-100:  #f5f5f5;
  --gray-200:  #eeeeee;
  --gray-300:  #e0e0e0;
  --gray-400:  #bdbdbd;
  --gray-500:  #9e9e9e;
  --gray-600:  #777777;
  --gray-700:  #616161;
  --gray-800:  #424242;
  --gray-900:  #212121;

  /* Semantic */
  --primary:       var(--orange-500);
  --primary-dark:  var(--orange-700);
  --primary-light: var(--orange-100);
  --accent:        var(--orange-300);
  --text:          var(--dark-200);
  --text-secondary: var(--gray-600);
  --bg:            var(--white);
  --bg-subtle:     var(--gray-50);
  --bg-dark:       var(--dark-300);
  --border:        var(--gray-200);

  /* Sizing */
  --max-width: 1120px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
}

/* ---- Reset ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---- Utilities ---- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease;
}

.navbar.scrolled {
  box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--dark-300);
}

.navbar__brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.navbar__brand span {
  color: var(--primary);
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Language switcher */
.lang-switch {
  display: flex;
  background: var(--gray-100);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.lang-switch button {
  font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  color: var(--gray-500);
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.lang-switch button.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.lang-switch button:hover:not(.active) {
  color: var(--gray-700);
}

/* ============================================
   HERO — Homepage
   ============================================ */
.hero {
  padding: 140px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--orange-50) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--orange-50);
  color: var(--orange-700);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 28px;
  border: 1px solid var(--orange-100);
}

.hero__badge svg {
  width: 14px;
  height: 14px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--dark-200);
  margin-bottom: 18px;
}

.hero h1 .accent {
  color: var(--primary);
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.18rem);
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 44px;
  font-weight: 300;
  line-height: 1.7;
}

/* ============================================
   DOWNLOADS GRID — Homepage
   ============================================ */
.downloads {
  padding: 20px 0 100px;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--dark-200);
  letter-spacing: -0.01em;
  margin-bottom: 40px;
}

.downloads__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* App card */
.app-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--orange-400), var(--orange-500));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.app-card:hover {
  border-color: var(--orange-200);
  box-shadow: 0 8px 32px rgba(255, 153, 0, 0.1), 0 2px 8px rgba(0,0,0,0.04);
  transform: translateY(-4px);
}

.app-card:hover::before {
  opacity: 1;
}

.app-card__icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  background: var(--orange-50);
  padding: 10px;
  object-fit: contain;
}

.app-card__name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  color: var(--dark-200);
}

.app-card__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex-grow: 1;
  font-weight: 400;
  line-height: 1.6;
}

.app-card__tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--orange-700);
  background: var(--orange-50);
  padding: 4px 12px;
  border-radius: 100px;
  width: fit-content;
}

.app-card__tag svg {
  width: 12px;
  height: 12px;
}

/* Placeholder card — "more coming" */
.app-card--placeholder {
  border-style: dashed;
  border-color: var(--gray-300);
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 260px;
  background: var(--gray-50);
}

.app-card--placeholder:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--gray-300);
}

.app-card--placeholder::before {
  display: none;
}

.app-card--placeholder svg {
  width: 40px;
  height: 40px;
  color: var(--gray-400);
  margin-bottom: 12px;
}

.app-card--placeholder p {
  font-size: 0.9rem;
  color: var(--gray-400);
  font-weight: 400;
}

/* ============================================
   APP PAGE — Hero
   ============================================ */
.app-hero {
  padding: 120px 0 60px;
  position: relative;
  overflow: hidden;
}

.app-hero::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--orange-50) 0%, transparent 65%);
  pointer-events: none;
}

.app-hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.app-hero__info {
  display: flex;
  flex-direction: column;
}

.app-hero__icon-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.app-hero__icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: var(--orange-50);
  padding: 14px;
  object-fit: contain;
  box-shadow: 0 4px 16px rgba(255,153,0,0.15);
}

.app-hero__name {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--dark-200);
}

.app-hero__tagline {
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 500;
  line-height: 1.7;
  margin-bottom: 20px;
}

.app-hero__desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 36px;
  font-weight: 400;
}

/* Download button */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary);
  color: var(--white);
  font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 16px rgba(255,153,0,0.3);
  width: fit-content;
}

.btn-download:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255,153,0,0.4);
}

.btn-download:active {
  transform: translateY(0);
}

.btn-download svg {
  width: 20px;
  height: 20px;
}

.btn-download__sub {
  font-size: 0.75rem;
  font-weight: 300;
  opacity: 0.85;
}

/* Hero illustration */
.app-hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-hero__illustration {
  max-width: 380px;
  width: 100%;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.06));
}

/* ============================================
   FEATURES — App Page
   ============================================ */
.features {
  padding: 80px 0;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.features__header {
  text-align: center;
  margin-bottom: 56px;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--orange-200);
  box-shadow: 0 4px 20px rgba(255,153,0,0.08);
}

.feature-card__icon {
  width: 56px;
  height: 56px;
  background: var(--orange-50);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  color: var(--orange-600);
}

.feature-card__icon svg {
  width: 26px;
  height: 26px;
}

.feature-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  color: var(--dark-200);
}

.feature-card__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.65;
}

/* ============================================
   SCREENSHOTS — App Page
   ============================================ */
.screenshots {
  padding: 80px 0;
}

.screenshots__header {
  text-align: center;
  margin-bottom: 48px;
}

.screenshots__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.screenshot-placeholder {
  aspect-ratio: 9/16;
  background: var(--gray-100);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  padding: 20px;
  text-align: center;
}

.screenshot-placeholder svg {
  width: 32px;
  height: 32px;
  margin-bottom: 10px;
  opacity: 0.5;
}

.screenshot-placeholder span {
  font-size: 0.78rem;
  font-weight: 400;
}

/* Filled screenshots */
.screenshots__gallery img {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* ============================================
   CTA — Bottom download
   ============================================ */
.cta {
  padding: 80px 0;
  text-align: center;
  background: var(--bg-dark);
  color: var(--white);
}

.cta h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  color: var(--white);
}

.cta p {
  font-size: 1rem;
  color: rgba(255,255,255,0.65);
  font-weight: 400;
  margin-bottom: 32px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.cta .btn-download {
  margin: 0 auto;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  background: var(--gray-50);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__copy {
  font-size: 0.82rem;
  color: var(--gray-500);
  font-weight: 400;
}

.footer__brand {
  font-size: 0.82rem;
  color: var(--gray-400);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer__brand img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  opacity: 0.5;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  opacity: 0;
  animation: fadeUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.12s; }
.animate-in:nth-child(3) { animation-delay: 0.19s; }
.animate-in:nth-child(4) { animation-delay: 0.26s; }

.delay-1 { animation-delay: 0.1s !important; }
.delay-2 { animation-delay: 0.2s !important; }
.delay-3 { animation-delay: 0.3s !important; }
.delay-4 { animation-delay: 0.4s !important; }
.delay-5 { animation-delay: 0.5s !important; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .navbar__inner {
    height: 56px;
  }

  .hero {
    padding: 110px 0 60px;
  }

  .app-hero {
    padding: 100px 0 40px;
  }

  .app-hero__inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .app-hero__icon-row {
    justify-content: center;
    flex-direction: column;
    gap: 12px;
  }

  .app-hero__tagline,
  .app-hero__desc {
    text-align: center;
  }

  .btn-download {
    margin: 0 auto;
  }

  .app-hero__visual {
    order: -1;
  }

  .app-hero__illustration {
    max-width: 260px;
  }

  .features__grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .feature-card {
    padding: 24px 18px;
  }

  .screenshots__gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .downloads__grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 18px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .features__grid {
    grid-template-columns: 1fr;
  }

  .screenshots__gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .lang-switch button {
    padding: 4px 10px;
    font-size: 0.72rem;
  }

  .cta h2 {
    font-size: 1.4rem;
  }
}
