/* Phase 1 global design-system foundation.
   Keeps the approved homepage intact while bringing the rest of the platform
   closer to the same mobile-first, task-first visual language. */

:root {
  --app-header-height: 86px;
  --app-mobile-header-height: 70px;
  --app-bottom-nav-height: 76px;
  --app-shell: min(1180px, calc(100% - 32px));
  --app-shell-wide: min(1360px, calc(100% - 32px));
  --app-card-pad: clamp(14px, 2vw, 22px);
}

html {
  scroll-padding-top: calc(var(--app-header-height) + 16px);
}

body.phase1-foundation {
  overflow-x: hidden;
  background: var(--paper);
}

body.phase1-foundation .app-main {
  isolation: isolate;
}

body.phase1-foundation .site-header {
  min-height: var(--app-header-height);
}

body.phase1-foundation .site-nav a,
body.phase1-foundation .site-footer a,
body.phase1-foundation .mobile-app-nav-item {
  text-decoration: none;
}

body.phase1-foundation .site-nav a:focus-visible,
body.phase1-foundation .site-footer a:focus-visible,
body.phase1-foundation .mobile-app-nav-item:focus-visible,
body.phase1-foundation .button:focus-visible,
body.phase1-foundation button:focus-visible,
body.phase1-foundation input:focus-visible,
body.phase1-foundation select:focus-visible,
body.phase1-foundation textarea:focus-visible {
  outline: 3px solid rgba(217, 180, 37, .7);
  outline-offset: 3px;
}

body.phase1-foundation .button,
body.phase1-foundation button.button {
  min-height: var(--touch);
  border-radius: 10px;
  font-weight: 950;
  letter-spacing: 0;
}

body.phase1-foundation .button.ghost {
  background: #fffaf3;
}

body.page-public .page-hero,
body.page-auth .page-hero {
  width: var(--app-shell);
  max-width: var(--app-shell);
  padding: clamp(34px, 5vw, 66px) 0 clamp(20px, 3vw, 34px);
  margin-inline: auto;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 14px;
}

body.page-public .page-hero .eyebrow,
body.page-auth .page-hero .eyebrow,
body.phase1-foundation .section-head .eyebrow {
  margin-bottom: 0;
  color: var(--red);
  font-weight: 950;
  letter-spacing: 0;
  text-align: center;
}

body.page-public .page-hero h1,
body.page-auth .page-hero h1 {
  max-width: 980px;
  margin: 0 auto;
  font-size: clamp(2.1rem, 5vw, 4.35rem);
  line-height: 1.04;
  text-align: center;
}

body.page-public .page-hero > p:not(.eyebrow),
body.page-auth .page-hero > p:not(.eyebrow) {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.phase1-foundation .section {
  width: 100%;
}

body.phase1-foundation .section > .section-head,
body.phase1-foundation .section-head {
  width: var(--app-shell);
  max-width: var(--app-shell);
  margin-inline: auto;
  text-align: center;
}

body.phase1-foundation .section-head h2 {
  max-width: 940px;
  margin-inline: auto;
  font-size: clamp(1.85rem, 4vw, 3.65rem);
  line-height: 1.06;
}

body.phase1-foundation .section-lead,
body.phase1-foundation .section-head > p:not(.eyebrow) {
  max-width: 780px;
  margin-inline: auto;
  color: var(--muted);
  font-weight: 750;
}

body.phase1-foundation .hero-search,
body.phase1-foundation .form-card,
body.phase1-foundation .panel,
body.phase1-foundation .profile-card,
body.phase1-foundation .product-card,
body.phase1-foundation .pricing-card,
body.phase1-foundation .role-card,
body.phase1-foundation .gallery-item-card,
body.phase1-foundation .customer-request-card {
  border-radius: 10px;
}

body.page-public .hero-search,
body.page-auth .hero-search {
  width: min(100%, 1020px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(234, 218, 198, .95);
  border-radius: 10px;
  background: rgba(255, 250, 243, .9);
  box-shadow: 0 18px 44px rgba(61, 35, 18, .08);
}

body.page-public .hero-search.compact {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

body.page-public .hero-search input,
body.page-public .hero-search select,
body.page-public .hero-search button,
body.page-auth .hero-search input,
body.page-auth .hero-search select,
body.page-auth .hero-search button {
  min-width: 0;
}

body.phase1-foundation .filter-summary,
body.phase1-foundation .trust-strip,
body.phase1-foundation .intent-chips,
body.phase1-foundation .hero-actions,
body.phase1-foundation .card-actions,
body.phase1-foundation .result-toolbar-actions {
  justify-content: center;
}

body.phase1-foundation .trust-strip,
body.phase1-foundation .intent-chips,
body.phase1-foundation .filter-summary {
  max-width: var(--app-shell);
  margin-inline: auto;
}

body.phase1-foundation .filter-summary span,
body.phase1-foundation .filter-summary strong,
body.phase1-foundation .filter-summary a,
body.phase1-foundation .trust-strip span,
body.phase1-foundation .intent-chips a {
  border-radius: 999px;
  text-align: center;
  line-height: 1.18;
}

body.phase1-foundation .cards,
body.phase1-foundation .role-grid,
body.phase1-foundation .pricing-grid,
body.phase1-foundation .gallery-grid,
body.phase1-foundation .check-grid,
body.phase1-foundation .feature-stack,
body.phase1-foundation .empty-recovery-grid {
  width: var(--app-shell);
  max-width: var(--app-shell);
  margin-inline: auto;
}

body.phase1-foundation .cards,
body.phase1-foundation .role-grid,
body.phase1-foundation .pricing-grid,
body.phase1-foundation .check-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

body.phase1-foundation .gallery-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

body.phase1-foundation .split,
body.phase1-foundation .grid-two,
body.phase1-foundation .visual-band {
  width: var(--app-shell);
  max-width: var(--app-shell);
  margin-inline: auto;
}

body.phase1-foundation .profile-card,
body.phase1-foundation .product-card,
body.phase1-foundation .pricing-card,
body.phase1-foundation .panel {
  overflow: hidden;
}

body.phase1-foundation .profile-card h3,
body.phase1-foundation .product-card h3,
body.phase1-foundation .pricing-card h2,
body.phase1-foundation .panel h3 {
  line-height: 1.16;
}

body.phase1-foundation .profile-card p,
body.phase1-foundation .product-card p,
body.phase1-foundation .pricing-card p,
body.phase1-foundation .panel p {
  line-height: 1.45;
}

body.phase1-foundation .profile-card .avatar,
body.phase1-foundation .product-card .product-image {
  box-shadow: 0 10px 24px rgba(61, 35, 18, .08);
}

body.phase1-foundation .marketplace-command-strip {
  width: min(100%, 1040px);
  margin-inline: auto;
}

body.phase1-foundation .marketplace-command-card {
  border-radius: 10px;
}

body.phase1-foundation .faq-list details,
body.phase1-foundation details {
  border-radius: 10px;
}

body.phase1-foundation .faq-list summary,
body.phase1-foundation details summary {
  cursor: pointer;
}

body.phase1-foundation .seo-reader-copy,
body.phase1-foundation .seo-support-content {
  max-width: var(--app-shell);
  margin-inline: auto;
}

body.phase1-foundation .seo-support-content {
  border-top: 1px solid rgba(234, 218, 198, .8);
}

body.phase1-foundation .site-footer {
  position: relative;
  overflow: hidden;
}

body.phase1-foundation .footer-grid,
body.phase1-foundation .footer-bottom {
  position: relative;
  z-index: 1;
}

body.phase1-foundation .footer-bottom {
  text-align: center;
}

@media (min-width: 901px) {
  body.phase1-foundation .site-nav.open {
    display: flex;
  }
}

@media (max-width: 900px) {
  html {
    scroll-padding-top: calc(var(--app-mobile-header-height) + 12px);
  }

  body.phase1-foundation {
    padding-top: var(--app-mobile-header-height);
    padding-bottom: calc(var(--app-bottom-nav-height) + env(safe-area-inset-bottom));
  }

  body.phase1-foundation .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: var(--app-mobile-header-height);
    z-index: 1000;
    background: rgba(255, 249, 240, .98);
    box-shadow: 0 10px 26px rgba(61, 35, 18, .08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  body.phase1-foundation .brand img {
    max-height: 54px;
    width: auto;
    max-width: 190px;
  }

  body.phase1-foundation .nav-toggle {
    min-height: 44px;
    border-radius: 8px;
  }

  body.phase1-foundation .site-nav {
    position: fixed;
    top: calc(var(--app-mobile-header-height) + 8px);
    left: 12px;
    right: 12px;
    z-index: 1001;
    max-height: calc(100vh - var(--app-mobile-header-height) - 24px);
    overflow: auto;
    border: 1px solid rgba(234, 218, 198, .92);
    border-radius: 12px;
    background: rgba(255, 250, 243, .98);
    box-shadow: 0 22px 50px rgba(61, 35, 18, .18);
  }

  body.phase1-foundation .site-nav.open {
    display: grid;
    gap: 6px;
    padding: 10px;
  }
}

@media (max-width: 760px) {
  :root {
    --app-shell: min(100% - 18px, 560px);
    --app-shell-wide: min(100% - 18px, 560px);
  }

  body.page-public .page-hero,
  body.page-auth .page-hero {
    width: var(--app-shell);
    padding: 28px 0 20px;
    gap: 10px;
  }

  body.page-public .page-hero h1,
  body.page-auth .page-hero h1 {
    font-size: clamp(1.48rem, 7vw, 2.05rem);
    line-height: 1.08;
  }

  body.page-public .page-hero > p:not(.eyebrow),
  body.page-auth .page-hero > p:not(.eyebrow) {
    max-width: 100%;
    -webkit-line-clamp: 2;
    font-size: .86rem;
    line-height: 1.42;
  }

  body.phase1-foundation .section {
    padding-left: 0;
    padding-right: 0;
  }

  body.phase1-foundation .section-head h2 {
    font-size: clamp(1.35rem, 6.6vw, 1.86rem);
  }

  body.phase1-foundation .section-lead,
  body.phase1-foundation .section-head > p:not(.eyebrow) {
    font-size: .86rem;
    line-height: 1.42;
  }

  body.page-public .hero-search,
  body.page-auth .hero-search {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 7px;
    border-radius: 9px;
  }

  body.page-public .hero-search.product-search,
  body.page-public .hero-search.discovery-search {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.page-public .hero-search input,
  body.page-public .hero-search select,
  body.page-public .hero-search button,
  body.page-auth .hero-search input,
  body.page-auth .hero-search select,
  body.page-auth .hero-search button {
    min-height: 34px;
    padding: 5px 6px;
    font-size: .56rem;
    border-radius: 7px;
  }

  body.phase1-foundation .filter-summary,
  body.phase1-foundation .trust-strip,
  body.phase1-foundation .intent-chips,
  body.phase1-foundation .hero-actions {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 4px;
    overflow: hidden;
  }

  body.phase1-foundation .filter-summary span,
  body.phase1-foundation .filter-summary strong,
  body.phase1-foundation .filter-summary a,
  body.phase1-foundation .trust-strip span,
  body.phase1-foundation .intent-chips a,
  body.phase1-foundation .hero-actions .button {
    min-width: 0;
    padding: 7px 4px;
    font-size: .5rem;
    line-height: 1.08;
    white-space: normal;
  }

  body.phase1-foundation .cards,
  body.phase1-foundation .role-grid,
  body.phase1-foundation .pricing-grid,
  body.phase1-foundation .gallery-grid,
  body.phase1-foundation .check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body.phase1-foundation .profile-card,
  body.phase1-foundation .product-card,
  body.phase1-foundation .pricing-card,
  body.phase1-foundation .role-card,
  body.phase1-foundation .panel,
  body.phase1-foundation .gallery-item-card {
    padding: 10px 8px;
    border-radius: 8px;
  }

  body.phase1-foundation .profile-card h3,
  body.phase1-foundation .product-card h3,
  body.phase1-foundation .pricing-card h2,
  body.phase1-foundation .panel h3 {
    font-size: .78rem;
    line-height: 1.12;
  }

  body.phase1-foundation .profile-card p,
  body.phase1-foundation .product-card p,
  body.phase1-foundation .pricing-card p,
  body.phase1-foundation .panel p,
  body.phase1-foundation .meta {
    font-size: .62rem;
    line-height: 1.25;
  }

  body.phase1-foundation .badge {
    padding: 4px 7px;
    font-size: .5rem;
  }

  body.phase1-foundation .card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  body.phase1-foundation .card-actions .button,
  body.phase1-foundation .button.small,
  body.phase1-foundation .button.tiny {
    min-height: 32px;
    padding: 6px 7px;
    font-size: .56rem;
  }

  body.phase1-foundation .split,
  body.phase1-foundation .grid-two,
  body.phase1-foundation .visual-band {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  body.phase1-foundation .visual-card,
  body.phase1-foundation .visual-card img,
  body.phase1-foundation .visual-card video {
    min-height: 210px;
  }

  body.phase1-foundation .marketplace-command-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  body.phase1-foundation .marketplace-command-card {
    min-height: 92px;
    padding: 9px 6px;
  }

  body.phase1-foundation .marketplace-command-card span,
  body.phase1-foundation .marketplace-command-card em {
    font-size: .48rem;
  }

  body.phase1-foundation .marketplace-command-card strong {
    font-size: .66rem;
    line-height: 1.1;
  }

  body.phase1-foundation .marketplace-command-card small {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: .54rem;
    line-height: 1.15;
  }

  body.phase1-foundation .pricing-compare {
    width: var(--app-shell);
    margin-inline: auto;
  }

  body.phase1-foundation .form-card label {
    gap: 5px;
  }

  body.phase1-foundation .form-card input,
  body.phase1-foundation .form-card textarea,
  body.phase1-foundation .form-card select {
    min-height: 38px;
    font-size: .82rem;
  }

  body.phase1-foundation .mobile-app-nav {
    min-height: var(--app-bottom-nav-height);
  }
}

@media (max-width: 390px) {
  body.page-public .hero-search,
  body.page-auth .hero-search {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.page-public .hero-search input,
  body.page-public .hero-search select,
  body.page-public .hero-search button,
  body.page-auth .hero-search input,
  body.page-auth .hero-search select,
  body.page-auth .hero-search button {
    font-size: .5rem;
    padding-left: 4px;
    padding-right: 4px;
  }

  body.phase1-foundation .filter-summary span,
  body.phase1-foundation .filter-summary strong,
  body.phase1-foundation .filter-summary a,
  body.phase1-foundation .trust-strip span,
  body.phase1-foundation .intent-chips a,
  body.phase1-foundation .hero-actions .button {
    font-size: .44rem;
    padding-left: 2px;
    padding-right: 2px;
  }

  body.phase1-foundation .cards,
  body.phase1-foundation .role-grid,
  body.phase1-foundation .pricing-grid,
  body.phase1-foundation .gallery-grid,
  body.phase1-foundation .check-grid {
    gap: 5px;
  }
}
