.hero {
  --header-height: 56px;
  background: var(--bg);
}

.hero.is-compact {
  position: sticky;
  top: calc(var(--header-height) * -1);
  z-index: 5;
  border-bottom: 1px solid var(--line);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: var(--header-height);
}

.logo {
  font-size: min(28px, 12vw - 18px);
  font-weight: 600;
  letter-spacing: -.01em;
  text-decoration: none;
}

.logo-tld {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.lang {
  display: flex;
  gap: 2px;
}

.lang a {
  padding: 7px 5px;
  border-radius: var(--r-pill);
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  transition: color var(--t-fast), background-color var(--t-fast);
}

.lang a[aria-current="true"] {
  background: var(--raised);
  color: var(--text);
}

.header-phone {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--text-soft);
  font-size: 15px;
  text-decoration: none;
  transition: color var(--t-fast);
}

.header-phone span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.hero-body {
  display: flex;
  flex-direction: column;
  padding-block: 24px 32px;
}

.is-compact .hero-body {
  padding-block: 0 10px;
}

.collapsible {
  display: grid;
  grid-template-rows: 1fr;
  width: 100%;
  opacity: 1;
  transition: grid-template-rows var(--t-move) var(--ease-move), opacity var(--t-move) var(--ease-out);
}

.collapsible > * {
  min-height: 0;
  overflow: hidden;
}

.is-compact .collapsible {
  grid-template-rows: 0fr;
  opacity: 0;
}

.hero-head {
  padding-bottom: 20px;
  animation: rise-in var(--t-slow) var(--ease-out) both;
}

.hero-title {
  font-size: clamp(22px, 6vw, 26px);
  font-weight: var(--fw-head);
  font-stretch: semi-condensed;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-wrap: balance;
}

/* The Armenian title is ~16.4em wide: size it to fit one line on phones. */
.hero-title:where(:lang(hy)) {
  font-size: min(26px, (100vw - 2 * var(--gutter)) / 16.8);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 68px;
  padding: 7px 7px 7px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--r-field);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(143, 179, 232, .08);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.is-compact .search {
  height: 58px;
  box-shadow: none;
}

.hero:not(.is-compact) .search {
  animation: rise-in var(--t-slow) 100ms var(--ease-out) both;
}

.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 5px rgba(143, 179, 232, .22);
}

.search.is-loading {
  animation: listening 1.6s var(--ease-move) infinite;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  font-size: 18px;
}

.search input::placeholder {
  color: var(--text-soft);
}

.search-filters {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  transition: background-color var(--t-fast), transform var(--t-fast);
}

.search-filters:active {
  transform: scale(.94);
}

.search-filters.has-filters::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-ink);
  box-shadow: 0 0 0 2px var(--accent);
  transition: box-shadow var(--t-fast);
}

.understood {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: center;
  margin: 10px calc(var(--gutter) * -1) 0;
  padding-inline: var(--gutter);
  color: var(--text-soft);
  font-size: var(--fs-meta);
}

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

.understood > * {
  flex: none;
}

.understood.is-thinking {
  animation: thinking 1.3s ease-in-out infinite;
}

.understood-chip {
  padding: 4px 9px;
  border-radius: var(--r-chip);
  background: var(--raised);
  color: var(--text);
  animation: chip-in var(--t-move) var(--ease-out) both;
}

.understood-chip:nth-child(3) { animation-delay: 50ms; }
.understood-chip:nth-child(4) { animation-delay: 100ms; }
.understood-chip:nth-child(5) { animation-delay: 150ms; }
.understood-chip:nth-child(n + 6) { animation-delay: 200ms; }

.search-hint {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: var(--fs-meta);
  line-height: 1.35;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
}

@keyframes chip-in {
  from { opacity: 0; transform: translateY(6px); }
}

@keyframes listening {
  50% { border-color: var(--accent-bright); box-shadow: 0 0 0 5px rgba(143, 179, 232, .16); }
}

@keyframes thinking {
  50% { opacity: .45; }
}

.site-footer {
  margin-top: 40px;
  padding-block: 24px;
  border-top: 1px solid var(--line);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 40px;
}

.footer-title {
  font-size: 20px;
  font-weight: var(--fw-head);
  font-stretch: semi-condensed;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-links a {
  padding-block: 6px;
  text-underline-offset: 4px;
  transition: color var(--t-fast);
}

.footer-note {
  max-width: 78ch;
  margin-top: 14px;
  color: var(--text-soft);
  font-size: 14px;
}

@media (min-width: 720px) {
  .hero {
    --header-height: 64px;
    display: flex;
    flex-direction: column;
  }

  .logo {
    font-size: 34px;
  }

  .header-actions {
    gap: 20px;
  }

  .header-phone {
    display: flex;
    gap: 8px;
    width: auto;
  }

  .header-phone span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }

  .header-phone:hover,
  .lang a:hover {
    color: var(--text);
  }

  .hero-body {
    align-items: center;
    padding-block: 12px 8px;
    text-align: center;
  }

  .is-compact .hero-body {
    padding-block: 0 14px;
  }

  .hero-head {
    padding-bottom: clamp(18px, 2.4vw, 28px);
  }

  .hero-title {
    font-size: clamp(30px, 3.6vw, 44px);
  }

  .search {
    width: min(100%, 840px);
    height: clamp(72px, 7vw, 84px);
    padding: 10px 10px 10px clamp(18px, 2vw, 26px);
  }

  .is-compact .search {
    height: 64px;
  }

  .search input {
    font-size: clamp(18px, 1.8vw, 21px);
  }

  .search-filters:hover {
    background: var(--accent-bright);
  }

  .search-filters:hover::after {
    box-shadow: 0 0 0 2px var(--accent-bright);
  }

  .understood {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    margin-inline: 0;
    padding-inline: 0;
    font-size: 15px;
  }

  .search-hint {
    margin-top: 8px;
    font-size: 16px;
  }

  .footer-links a:hover {
    color: var(--accent);
  }
}
