/* Responsive layer for site/home.html only.
   Keeps the existing desktop design and JavaScript behavior intact. */

@media (max-width: 1180px) {
  .topbar {
    padding: 16px 20px;
    gap: 16px;
  }

  .nav {
    max-width: min(620px, 58vw);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    padding: 8px 12px;
    font-size: 12px;
  }

  .hero {
    left: 24px;
    width: calc(100vw - 48px);
    grid-template-columns: minmax(420px, .86fr) minmax(420px, 1fr);
    gap: 12px;
  }

  .hero h1 {
    font-size: clamp(40px, 5vw, 58px);
  }

  .hero-product-mockups {
    width: min(600px, 50vw);
  }
}

@media (max-width: 980px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app,
  .map-area {
    height: auto;
    position: relative;
    min-height: 100svh;
    overflow: visible;
  }

  #map,
  .vignette {
    position: fixed;
  }

  .topbar {
    position: relative;
    align-items: flex-start;
    padding: 16px 18px 0;
  }

  .logo {
    flex: 0 0 auto;
  }

  .nav {
    max-width: calc(100vw - 250px);
  }

  .hero {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    transform: none;
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 56px 18px 24px;
    text-align: left;
  }

  .hero-copy,
  .hero h1,
  .hero p,
  .hero .search-wrap,
  .hero-examples,
  .coverage-note {
    max-width: none;
  }

  .hero h1 {
    font-size: clamp(40px, 8vw, 62px);
  }

  .hero-visual {
    min-height: 0;
    padding-bottom: 0;
    transform: none;
  }

  .hero-product-mockups {
    width: min(720px, 94vw);
    min-height: 360px;
  }

  .hero-visual .hero-doc-essential,
  .hero-visual .hero-doc-market {
    width: min(260px, 36vw);
  }

  .hero-indicators-bar {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: auto;
    margin: 0 18px 22px;
    z-index: 8;
  }

  .hib-card {
    min-height: 88px;
    padding: 14px 10px;
  }

  .status-bar {
    position: fixed;
    bottom: 14px;
  }

  body.active .hero {
    position: fixed;
    top: 14px;
    left: 50%;
    width: min(520px, calc(100vw - 28px));
    margin: 0;
    transform: translateX(-50%);
    display: block;
    z-index: 12;
  }

  body.active .hero-copy {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .logo {
    padding-left: 0;
  }

  .logo-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .logo-text > span:first-child {
    font-size: 15px;
  }

  .logo-sub {
    font-size: 6.8px;
  }

  .nav {
    order: 2;
    width: 100%;
    max-width: none;
    justify-content: flex-start;
    border-radius: 15px;
  }

  .nav a {
    font-size: 11.5px;
    padding: 8px 10px;
  }

  .hero {
    margin: 34px 16px 20px;
    gap: 20px;
  }

  .hero-eyebrow {
    max-width: 100%;
    white-space: normal;
    line-height: 1.35;
    align-items: flex-start;
  }

  .hero h1 {
    font-size: clamp(34px, 10vw, 48px);
    line-height: 1;
  }

  .hero p {
    font-size: 15px;
  }

  .hero .search-wrap {
    width: 100%;
    max-width: 100%;
    border-radius: 18px;
    padding: 7px;
  }

  .hero .search-inner {
    flex-wrap: wrap;
  }

  .hero .search-wrap input {
    min-width: 0;
    width: calc(100% - 42px);
    font-size: 14px;
    padding: 14px 4px;
  }

  .hero .search-btn {
    width: 100%;
    height: 48px;
    border-radius: 12px;
  }

  .coverage-note {
    justify-content: flex-start;
    text-align: left;
  }

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

  .hero-product-mockups {
    min-height: 300px;
    gap: 8px;
  }

  .hero-visual .hero-doc-essential,
  .hero-visual .hero-doc-market {
    width: min(180px, 39vw);
  }

  .hero-doc-label {
    display: none;
  }

  .hero-indicators-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 16px 88px;
  }

  .hib-card {
    min-height: 82px;
    border-radius: 14px;
  }

  .hib-emoji {
    font-size: 20px;
  }

  .hib-label {
    font-size: 11.5px;
  }

  .hib-desc {
    display: none;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 78vh;
    height: 72vh;
    transform: translateY(calc(100% + 20px));
    z-index: 30;
  }

  .sidebar.open {
    transform: translateY(0) !important;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 12px 14px 0;
  }

  .nav {
    display: flex;
    padding: 4px;
  }

  .nav a {
    flex: 0 0 auto;
  }

  .hero {
    margin: 30px 14px 18px;
  }

  .hero h1 {
    font-size: clamp(32px, 11vw, 42px);
  }

  .hero p {
    font-size: 14px;
    line-height: 1.55;
  }

  .search-icon {
    padding-left: 9px;
  }

  .hero .search-wrap input {
    font-size: 13.5px;
    font-weight: 700;
  }

  .coverage-note {
    gap: 7px;
    font-size: 11px;
  }

  .coverage-sep {
    display: none;
  }

  .example-chips {
    grid-template-columns: 1fr;
  }

  .example-chip {
    min-height: 58px;
  }

  .hero-product-mockups {
    min-height: 230px;
    align-items: flex-end;
  }

  .hero-visual .hero-doc-essential,
  .hero-visual .hero-doc-market {
    width: min(132px, 39vw);
  }

  .hero-product-plus {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 18px !important;
    margin-bottom: 22px;
  }

  .hero-indicators-bar {
    gap: 8px;
    margin: 0 14px 84px;
  }

  .hib-card {
    min-height: 74px;
    padding: 12px 8px;
  }

  .status-bar {
    max-width: calc(100vw - 28px);
    overflow: hidden;
  }

  body.active .hero {
    top: 10px;
    width: calc(100vw - 20px);
  }

  body.active .hero .search-wrap input {
    width: calc(100% - 34px);
    padding: 10px 2px;
    font-size: 12px;
  }

  body.active .hero .search-btn {
    height: 38px;
    font-size: 12px;
  }
}

@media (max-width: 390px) {
  .logo-sub {
    display: none;
  }

  .nav a {
    font-size: 11px;
    padding: 7px 9px;
  }

  .hero h1 {
    font-size: 31px;
  }

  .hero .search-wrap input {
    font-size: 12.5px;
  }

  .hero-product-mockups {
    min-height: 205px;
  }

  .hero-visual .hero-doc-essential,
  .hero-visual .hero-doc-market {
    width: min(116px, 38vw);
  }

  .hero-indicators-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 720px) and (min-width: 981px) {
  .hero {
    top: 43%;
  }

  .hero h1 {
    font-size: clamp(38px, 4.4vw, 58px);
  }

  .hero-visual {
    min-height: 480px;
  }

  .hero-product-mockups {
    min-height: 430px;
  }

  .hero-indicators-bar {
    bottom: 12px;
  }

  .hib-card {
    min-height: 78px;
    padding: 12px 10px;
  }

  .hib-desc {
    display: none;
  }
}
