/* =========================================================
   Homeloom Landing Page
   Responsive breakpoints for desktop, tablet, and mobile.
   ========================================================= */

/* Desktop tightening */
@media (max-width: 1120px) {
  .vision-grid,
  .story-grid {
    gap: 46px;
  }

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

  .legal-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 30px;
  }
}

/* Tablet */
@media (max-width: 900px) {
  :root {
    --header-height: 70px;
  }

  .container {
    width: min(100% - 36px, var(--container));
  }

  .hero {
    min-height: 86svh;
  }

  .hero-inner {
    padding: 96px 0 64px;
  }

  .hero-scrim {
    background:
      linear-gradient(90deg, rgba(252, 251, 255, 0.98) 0%, rgba(252, 251, 255, 0.84) 52%, rgba(252, 251, 255, 0.34) 100%),
      linear-gradient(180deg, rgba(252, 251, 255, 0.82) 0%, rgba(252, 251, 255, 0.2) 42%, rgba(252, 251, 255, 0.97) 100%);
  }

  .vision-grid,
  .story-grid {
    grid-template-columns: 1fr;
  }

  .story-image {
    order: 2;
  }

  .story-copy {
    order: 1;
  }

  .principle-grid,
  .how-grid {
    grid-template-columns: 1fr;
  }

  .principle,
  .how-card {
    min-height: auto;
  }

  .download-inner {
    padding: 42px;
  }

  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-summary {
    position: static;
  }
}

/* Mobile navigation and compact layouts */
@media (max-width: 760px) {
  .nav {
    min-height: 68px;
  }

  .brand img {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-toggle.is-open span[aria-hidden="true"]:nth-child(2) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle.is-open span[aria-hidden="true"]:nth-child(3) {
    opacity: 0;
  }

  .nav-toggle.is-open span[aria-hidden="true"]:nth-child(4) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 18px;
    left: 18px;
    display: grid;
    gap: 6px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--color-border);
    border-radius: 22px;
    box-shadow: var(--shadow-card);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
  }

  .nav-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-menu a {
    justify-content: center;
    min-height: 46px;
  }

  .legal-nav-menu {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .legal-nav-menu a {
    min-height: 38px;
    padding-inline: 10px;
    font-size: 0.88rem;
  }

  .section {
    padding: 86px 0;
  }

  .section-slim {
    padding: 20px 0 72px;
  }

  .hero {
    min-height: 86svh;
  }

  .hero-media {
    inset: 0 0 0 12%;
  }

  .hero-photo {
    object-position: 52% center;
  }

  .hero-copy {
    width: min(550px, 100%);
  }

  .hero-actions,
  .download-actions {
    width: 100%;
  }

  .button {
    min-height: 52px;
  }

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

  .feature-card {
    min-height: auto;
  }

  .assist-card {
    grid-template-columns: 1fr;
  }

  .newsletter-form {
    grid-template-columns: 1fr;
  }

  .newsletter-form .button {
    width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .site-footer nav {
    justify-content: flex-start;
  }
}

/* Small mobile */
@media (max-width: 560px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .hero {
    min-height: auto;
  }

  .hero-media {
    inset: 0;
  }

  .hero-scrim {
    background:
      linear-gradient(180deg, rgba(252, 251, 255, 0.96) 0%, rgba(252, 251, 255, 0.76) 52%, rgba(252, 251, 255, 0.98) 100%),
      linear-gradient(90deg, rgba(252, 251, 255, 0.92) 0%, rgba(252, 251, 255, 0.44) 100%);
  }

  .hero-inner {
    min-height: 82svh;
    padding: 88px 0 54px;
  }

  .hero h1 {
    font-size: clamp(3.1rem, 16vw, 4.2rem);
  }

  .hero-subtitle,
  .section-lead,
  .legal-intro {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .button {
    width: 100%;
  }

  .section-heading {
    margin-bottom: 34px;
  }

  .section-heading h2,
  .section-copy h2,
  .story-copy h2,
  .download-copy h2 {
    font-size: clamp(2.25rem, 11vw, 3.35rem);
    line-height: 1.03;
  }

  .vision-image img,
  .story-image img,
  .download-inner,
  .legal-document {
    border-radius: 22px;
  }

  .principle,
  .how-card,
  .feature-card,
  .assist-card {
    padding: 24px;
    border-radius: 18px;
  }

  .download-inner {
    padding: 28px;
  }

  .download-actions {
    display: grid;
  }

  .store-button {
    width: 100%;
  }

  .legal-hero {
    padding: 74px 0 36px;
  }

  .legal-hero h1 {
    font-size: clamp(3rem, 15vw, 4.2rem);
  }

  .legal-content {
    padding: 36px 0 76px;
  }

  .legal-document {
    padding: 28px;
  }
}

/* Narrow phones */
@media (max-width: 390px) {
  .brand {
    font-size: 1.05rem;
  }

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

  .button {
    padding-inline: 18px;
  }
}
