/* ============================================================
   PIEDRASANTA.SPACE — Responsive
   Mobile-first breakpoints
   ============================================================ */

/* ── Tablet: ≥ 768px ── */
@media (min-width: 768px) {
  .nav__hamburger { display: none; }
  .nav__links     { display: flex; }
  .nav__drawer    { display: none !important; }
}

/* ── Mobile: < 768px ── */
@media (max-width: 767.98px) {
  :root {
    --gutter: 1.25rem;
  }

  .nav__links { display: none; }
  .nav__cta   { display: none; }
  .nav__hamburger { display: flex; }
  .nav__drawer    { display: flex; }

  /* Hero */
  .hero__headline { max-width: 100%; }
  .hero__sub      { font-size: var(--text-base); }
  .hero__actions  { flex-direction: column; align-items: flex-start; }
  .hero__actions .btn { width: 100%; justify-content: center; }

  /* Stat bar */
  .stat-bar__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-6);
  }

  .stat-bar__item { border-left: 1px solid var(--border-mid); padding-left: var(--sp-4); }
  .stat-bar__item:nth-child(1),
  .stat-bar__item:nth-child(2) { border-left: none; padding-left: 0; }

  /* Services */
  .services { padding-block: var(--sp-16); }
  .services__grid { grid-template-columns: 1fr; }

  /* Portfolio */
  .portfolio { padding-block: var(--sp-16); }
  .portfolio__header { flex-direction: column; align-items: flex-start; }
  .portfolio__grid { grid-template-columns: 1fr; }
  .portfolio__grid .portfolio-card:first-child {
    grid-column: span 1;
    aspect-ratio: 4/3;
  }

  /* Contact */
  .contact { padding-block: var(--sp-16); }
  .contact__inner { grid-template-columns: 1fr; gap: var(--sp-12); }
  .contact__form-row { grid-template-columns: 1fr; }

  /* Footer */
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--sp-8);
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--sp-3);
    text-align: center;
  }
}

/* ── Small tablet: 768px–1023px ── */
@media (min-width: 768px) and (max-width: 1023px) {
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portfolio__grid .portfolio-card:first-child {
    grid-column: span 2;
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-10);
  }

  .footer__grid > *:first-child { grid-column: span 2; }
}

/* ── Large: ≥ 1024px ── */
@media (min-width: 1024px) {
  .services__grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ═══════════════════════════════════════════════════════
   SOFTWARE PAGE
════════════════════════════════════════════════════════ */

/* ── Mobile: < 768px ── */
@media (max-width: 767.98px) {
  .soft-hero__inner { padding-block: var(--sp-16) var(--sp-12); }
  .soft-hero__title { max-width: 100%; }
  .soft-hero__sub { font-size: var(--text-base); }
  .soft-hero__actions { flex-direction: column; align-items: flex-start; }
  .soft-hero__actions .btn { width: 100%; justify-content: center; }
  .soft-hero__meta { margin-top: var(--sp-8); gap: var(--sp-2); }

  .stats__grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); }
  .stats__item { padding-left: var(--sp-4); }
  .stats__item:nth-child(1),
  .stats__item:nth-child(2) { border-left: none; padding-left: 0; }
  .stats__value { font-size: var(--text-2xl); }

  .section-head { margin-bottom: var(--sp-8); }
  .paid, .open-source { padding-block: var(--sp-16); }
  .paid-grid { grid-template-columns: 1fr; }
  .paid-card__body { padding: var(--sp-6); }
  .paid-cta { padding: var(--sp-6); }
  .paid-cta .btn { width: 100%; justify-content: center; }
  .paid-license { flex-wrap: wrap; }
  .paid-license .btn { margin-left: 0; width: 100%; justify-content: center; }

  .platform__head { padding: var(--sp-4) var(--sp-5); gap: var(--sp-3); }
  .platform__meta { margin-left: 0; order: 4; width: 100%; }
  .platform__sync { margin-left: 0; order: 5; width: 100%; white-space: normal; }
  .platform__profile, .platform__lock { margin-left: auto; }
  .repo-status { padding-inline: var(--sp-5); }

  /* Table → stacked cards */
  .repo-table thead { display: none; }
  .repo-table,
  .repo-table tbody,
  .repo-table tr,
  .repo-table td { display: block; width: 100%; }

  .repo-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name stars"
      "desc desc"
      "repo action";
    gap: var(--sp-3) var(--sp-4);
    padding: var(--sp-5);
    border-bottom: 1px solid var(--border-subtle);
  }

  .repo-table tbody tr:last-child { border-bottom: none; }
  .repo-table td { padding: 0; border: none; }
  .repo-table td:nth-child(1) { grid-area: name; min-width: 0; }
  .repo-table td:nth-child(2) { grid-area: stars; justify-self: end; align-self: start; }
  .repo-table td:nth-child(3) { grid-area: desc; }
  .repo-table td:nth-child(4) { grid-area: repo; min-width: 0; }
  .repo-table td:nth-child(5) { grid-area: action; justify-self: end; text-align: right; }
  .repo-table tbody tr:hover td:first-child { box-shadow: none; }

  .repo-name { font-size: var(--text-lg); }
  .repo-desc { -webkit-line-clamp: 3; }
  .repo-loading { display: block !important; padding: 0; }
  .repo-loading td { display: block; padding: var(--sp-6); }
}

/* ── Small tablet: 768px–1023px ── */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .paid-grid { grid-template-columns: 1fr 1fr; }
  .paid-card__body { padding-inline: var(--sp-6); }
  .repo-table th,
  .repo-table td { padding-inline: var(--sp-4); }
  .platform__sync { font-size: 10px; }
  .repo-col--name   { width: 24%; }
  .repo-col--stars  { width: 9%; }
  .repo-col--desc   { width: 36%; }
  .repo-col--repo   { width: 18%; }
  .repo-col--action { width: 13%; }
}
