/* Download page: concept styling */

/* Hero */
.download-hero {
  position: relative;
  padding: 9rem 1.25rem 4rem;
  color: #fff;
  overflow: hidden;
}
.download-hero .download-hero-background {
  position: absolute; inset: 0; z-index: -1;
}
.download-hero .download-gradient {
  position: absolute; inset: 0;
  background: var(--primary-gradient);
  opacity: .95;
}
.download-hero .download-hero-content {
  max-width: 1100px; margin: 0 auto;
}
.download-title { font-family: var(--font-display); font-size: 3.25rem; line-height: 1.1; }
.download-title .title-accent { color: var(--title-accent-color); }
.download-subtitle { margin-top: .75rem; opacity: .95; font-size: 1.125rem; }

/* Options grid */
.download-options { padding: 3rem 1.25rem; }
.options-grid {
  display: grid; gap: 1rem; grid-template-columns: repeat(12, 1fr);
  max-width: 1100px; margin: 0 auto;
}
.option-card {
  grid-column: span 12;
  background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius-xl);
  padding: 1.25rem; box-shadow: var(--shadow-sm);
}
.option-icon { width: 36px; height: 36px; color: var(--color-primary); }
.option-icon svg { width: 100%; height: 100%; }
.option-title { margin-top: .5rem; font-size: 1.25rem; font-weight: 700; }
.option-description { margin-top: .25rem; color: var(--neutral-600); }
.code-snippet {
  margin-top: .75rem; background: #0b1220; color: #e5e7eb; border-radius: var(--radius-lg);
  padding: .75rem; overflow: auto; font-family: var(--font-mono); font-size: .9rem;
}
.btn-tertiary { display: inline-block; margin-top: .75rem; }

@media (min-width: 800px) {
  .option-card { grid-column: span 6; }
}

/* License section */
.license-section { padding: 2.5rem 1.25rem; background: linear-gradient(180deg, #f8fafc, #ffffff); }
.license-section .subsection-title {
  margin-top: var(--space-6);
}
.license-card {
  max-width: 1100px; margin: 0 auto; display: grid; gap: 1.25rem;
  grid-template-columns: 1fr; align-items: center;
  background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius-2xl);
  padding: 1.25rem; box-shadow: var(--shadow-md);
}
.license-title { font-size: 1.25rem; font-weight: 800; }
.license-text { color: var(--neutral-700); margin-top: .35rem; }
.license-actions { display: flex; gap: .75rem; align-items: center; margin-top: .75rem; flex-wrap: wrap; }
.license-consent { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; }
.license-help { margin-top: .35rem; color: var(--neutral-500); font-size: .9rem; }
.btn-ghost {
  display: inline-block;
  padding: .6rem .9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-300);
  background: var(--neutral-100);
  color: var(--neutral-800);
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn-ghost:hover {
  background: var(--neutral-200);
  border-color: var(--neutral-400);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.download-cta { display: grid; justify-items: start; gap: .75rem; }
.version-pill { background: #eef2ff; color: #3730a3; border-radius: 999px; font-weight: 700; padding: .25rem .6rem; font-size: .85rem; }
.is-disabled { pointer-events: none; opacity: .5; }
.download-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .35rem; }
.download-meta a { color: var(--neutral-600); font-size: .95rem; text-decoration: underline; }

@media (min-width: 900px) {
  .license-card { grid-template-columns: 1.5fr .9fr; padding: 1.5rem; }
  .download-cta { justify-items: end; }
}

/* Package contents */
.package-section { 
  padding: 2.5rem 1.25rem 3.5rem; 
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* Package tree container */
.package-tree {
  width: 100%;
  margin: 0 auto 2.5rem;
  background: linear-gradient(145deg, #020617 0%, #0b1220 100%);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: 
    0 25px 50px -12px rgba(15, 23, 42, 0.6),
    0 0 0 1px rgba(15, 23, 42, 0.9) inset;
  font-size: 0.95rem;
}

.package-tree-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.package-tree-header .folder-icon {
  color: #fbbf24;
}

.package-tree-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  color: #e2e8f0;
}

.package-tree-content {
  padding: 1rem 1.25rem 1.25rem;
}

/* Tree folder */
.tree-folder {
  margin-bottom: 1rem;
}

.tree-folder:last-child {
  margin-bottom: 0;
}

.tree-folder-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.tree-folder-header .tree-icon {
  color: #60a5fa;
  flex-shrink: 0;
}

.tree-folder-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  color: #93c5fd;
}

.tree-folder-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: rgba(100, 116, 139, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-left: auto;
}

.tree-folder-desc {
  margin: 0.25rem 0 0 1.5rem;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.5;
}

/* Tree groups */
.tree-group {
  margin-left: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tree-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.tree-group-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.tree-group-label code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.75rem;
  color: #cbd5e1;
}

.tree-group-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.tree-group-tag.umd {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  color: #fff;
}

.tree-group-tag.esm {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
}

.tree-group-tag.types {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
}

.tree-group-types {
  padding-top: 0.5rem;
}

/* Tree files */
.tree-files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tree-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  margin-left: 0.5rem;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 10px 20px -8px rgba(15, 23, 42, 0.85);
  transition: background 0.15s ease;
}

.tree-file:hover {
  background: rgba(30, 64, 175, 0.9);
  border-color: rgba(129, 140, 248, 0.9);
}

.tree-file .tree-icon {
  color: #64748b;
  flex-shrink: 0;
}

.tree-file-name {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: #e2e8f0;
  min-width: 0;
}

.tree-file-size {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: auto;
}

.tree-file-gzip {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.5rem;
}

.tree-file-note {
  font-size: 0.75rem;
  color: #64748b;
  margin-left: auto;
}

.tree-file-secondary {
  opacity: 0.7;
}

.tree-file-secondary .tree-file-name {
  font-weight: 400;
  color: #94a3b8;
}

/* Map file emphasis */
.tree-file-map .tree-file-name {
  color: #bfdbfe;
}

.tree-file-note-strong {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #e5e7eb;
  background: rgba(30, 64, 175, 0.5);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

/* Demo folder special styling */
.tree-folder-demo {
  background: rgba(251, 191, 36, 0.03);
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.5rem;
}

.tree-folder-demo .tree-folder-header {
  padding: 0 0 0.25rem 0;
}

.tree-folder-demo .tree-icon {
  color: #fbbf24;
}

.tree-folder-demo .tree-folder-name {
  color: #fbbf24;
}

/* Package tree footer */
.package-tree-footer {
  padding: 0.9rem 1.25rem;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.package-tree-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #e5e7eb;
}

.package-tree-note svg {
  color: #475569;
  flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 760px) {
  .tree-file {
    flex-wrap: wrap;
  }

  .tree-file .tree-icon {
    order: 0;
  }

  .tree-file-name {
    order: 1;
  }

  .tree-file::after {
    content: "";
    order: 2;
    flex-basis: 100%;
  }

  .tree-file-size {
    order: 3;
    margin-left: 1.25rem;
  }

  .tree-file-gzip {
    order: 4;
    margin-left: 0.5rem;
  }

  .tree-file-note {
    order: 5;
    flex-basis: 100%;
    margin-left: 1.25rem;
  }
}

@media (max-width: 600px) {
  .package-tree {
    border-radius: var(--radius-xl);
  }
  
  .tree-file {
    gap: 0.3rem;
  }
}

@media (max-width: 520px) {
  .tree-file-name {
    overflow-wrap: anywhere;
  }
}

/* Release notes */
.whats-new { padding: 2.5rem 1.25rem; background: #fafafa; }
.release-card { margin: 0 auto; border: 1px solid var(--neutral-200); border-radius: var(--radius-xl); background: #fff; }
.whats-new .release-card + .release-card { margin-top: 1rem; }
.release-summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; font-weight: 700; }
.release-content { padding: 0 1.25rem 1.25rem; }
.release-content h3 { margin-top: .5rem; font-size: 1.1rem; }
.release-list { margin-top: .35rem; padding-left: 1.1rem; }

/* CTA grid reused from docs */
.docs-cta { padding: 2.5rem 1.25rem; }
.cta-grid { max-width: 900px; margin: 0 auto; display: grid; gap: 1rem; grid-template-columns: 1fr; }
.cta-card { display: block; padding: 1.25rem; border: 1px solid var(--neutral-200); border-radius: var(--radius-xl); background: #fff; box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; }
.cta-card h3 { font-size: 1.25rem; }
.cta-card p { margin-top: .25rem; color: var(--neutral-600); }
.cta-card .cta-link { display: inline-block; margin-top: .5rem; color: var(--color-primary); font-weight: 600; }
@media (min-width: 840px) { .cta-grid { grid-template-columns: 1fr 1fr; } }
