.site-header {
  position: absolute;
  z-index: 50;
  inset: 0 0 auto;
  height: var(--header-height);
  color: var(--text-secondary);
}

.home-page .site-header,
.tool-detail-page .site-header {
  position: sticky;
  inset: 0 0 auto;
  margin-bottom: calc(var(--header-height) * -1);
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.home-page .site-header.site-header--scrolled,
.tool-detail-page .site-header.site-header--scrolled {
  border-bottom-color: var(--border-overlay-muted);
  background: color-mix(in srgb, var(--surface-background) 86%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.site-header__inner {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: minmax(104px, 1fr) auto minmax(104px, 1fr);
  gap: var(--space-lg);
  align-items: center;
  padding: 0 var(--space-xl);
}

.brand-logo {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0;
}

.brand-logo__mark {
  display: grid;
  width: 28px;
  height: 28px;
  margin-right: 7px;
  place-items: center;
  border-radius: 8px;
  background: #0a0a0a;
}

.brand-logo__mark img {
  width: 14px;
  height: auto;
}

.brand-logo__word {
  width: 63px;
  height: 16px;
}

.brand-logo__separator.ui-separator--vertical {
  height: 16px;
  margin-inline: var(--space-md);
  background: var(--border-overlay);
}

.brand-logo__context {
  color: var(--text-primary);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-6);
  white-space: nowrap;
}

:root[data-theme="dark"] .brand-logo__word,
:root[data-theme="dark"] .theme-aware-icon {
  filter: invert(1);
}

.primary-nav,
.primary-nav__list,
.header-actions {
  display: flex;
  align-items: center;
}

.primary-nav__list {
  gap: var(--space-3xs);
  padding: 0;
  margin: 0;
  list-style: none;
}

.primary-nav__group-list {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 2px;
  margin: 0;
  border-radius: var(--radius-3xl);
  background: var(--component-translucent-subtle);
  list-style: none;
}

.nav-link {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: var(--space-3xs);
  padding: 0 var(--space-sm);
  border: 0;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  background: transparent;
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link[aria-expanded="true"],
.nav-link[aria-current="location"] {
  color: var(--text-primary);
  background: var(--component-translucent-subtle);
}

.nav-link > img {
  width: 16px;
  height: 16px;
}

.nav-link__chevron {
  width: 12px !important;
  height: 12px !important;
}

.nav-menu {
  position: relative;
}

.nav-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  display: grid;
  width: 260px;
  gap: var(--space-4xs);
  padding: var(--space-2xs);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  background: var(--surface-popover);
  box-shadow: var(--shadow-xl);
  transform: translateX(-50%);
}

.nav-menu__panel a {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.nav-menu__panel a:hover,
.nav-menu__panel a:focus-visible {
  color: var(--text-primary);
  background: var(--component-translucent-subtle);
}

.header-actions {
  justify-content: flex-end;
  gap: var(--space-2xs);
}

.header-actions .ui-separator--vertical {
  margin-inline: var(--space-4xs);
}

.mobile-menu-toggle {
  display: none;
}

.mobile-navigation {
  position: absolute;
  top: 52px;
  right: 12px;
  left: 12px;
  display: grid;
  max-height: calc(100vh - 68px);
  gap: var(--space-2xs);
  padding: var(--space-sm);
  overflow-y: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-3xl);
  background: var(--surface-popover);
  box-shadow: var(--shadow-2xl);
}

.mobile-navigation__label {
  padding: var(--space-sm) var(--space-sm) var(--space-4xs);
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
}

.mobile-navigation a {
  min-height: 44px;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.mobile-navigation a:hover,
.mobile-navigation a:focus-visible {
  color: var(--text-primary);
  background: var(--component-translucent-subtle);
}

.hero {
  position: relative;
  height: 620px;
  overflow: hidden;
  background: var(--home-hero-gradient), var(--surface-background);
}

.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(800px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: 184px;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--font-size-6xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-tighter);
  line-height: var(--line-height-18);
}

.hero__subtitle {
  margin: 8px 0 24px;
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-6);
}

.hero-icon {
  position: absolute;
  z-index: 1;
  display: grid;
  width: 68px;
  height: 68px;
  padding: 14px;
  place-items: center;
  border-radius: 18px;
  background: var(--component-ring-background);
  box-shadow: 0 18px 30px rgb(20 46 80 / 12%);
  pointer-events: none;
  user-select: none;
}

.hero-icon img {
  width: 40px;
  height: 40px;
}

.hero-icon--01 { top: 382px; left: calc(50% + 332px); }
.hero-icon--02 { top: 312px; left: calc(50% + 486px); }
.hero-icon--03 { top: 90px; left: calc(50% + 424px); }
.hero-icon--04 { top: 256px; left: calc(50% + 676px); }
.hero-icon--05 { top: 388px; left: calc(50% + 608px); }
.hero-icon--06 { top: 159px; left: calc(50% + 554px); }
.hero-icon--07 { top: 431px; left: calc(50% + 137px); }
.hero-icon--08 { top: 453px; left: calc(50% - 130px); }
.hero-icon--09 { top: 388px; left: calc(50% - 358px); }
.hero-icon--10 { top: 185px; left: calc(50% - 703px); }
.hero-icon--11 { top: 263px; left: calc(50% - 502px); }
.hero-icon--12 { top: 76px; left: calc(50% + 88px); }
.hero-icon--13 { top: 101px; left: calc(50% - 88px); }
.hero-icon--14 { top: 100px; left: calc(50% - 540px); --hero-base-rotation: -12deg; }
.hero-icon--15 { top: 362px; left: calc(50% - 623px); }
.hero-icon--16 { top: 117px; left: calc(50% - 358px); }

.hero-decor {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

.hero-decor--orbit {
  top: 90px;
  left: calc(50% - 212px);
  width: 96px;
  --hero-base-rotation: -25.4deg;
}

.hero-decor--arrow {
  top: 209px;
  left: calc(50% - 416px);
  width: 139px;
}

.hero-decor--pen {
  top: 186px;
  left: calc(50% + 277px);
  width: 147px;
}

.hero-icon,
.hero-decor {
  --hero-base-rotation: 0deg;
  --hero-float-x: 6px;
  --hero-float-x-opposite: -6px;
  --hero-float-y: 8px;
  --hero-float-y-opposite: -8px;
  --hero-float-rotate: 4deg;
  --hero-float-rotate-opposite: -4deg;
  --hero-repel-x: 0px;
  --hero-repel-y: 0px;
  translate: var(--hero-repel-x) var(--hero-repel-y);
  animation: hero-element-float var(--hero-float-duration, 7s) ease-in-out var(--hero-float-delay, 0s) infinite;
  will-change: transform, translate;
}

.hero-icon--14 {
  --hero-base-rotation: -12deg;
}

.hero-decor--orbit {
  --hero-base-rotation: -25.4deg;
}

@keyframes hero-element-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(var(--hero-base-rotation));
  }

  25% {
    transform:
      translate3d(var(--hero-float-x), var(--hero-float-y-opposite), 0)
      rotate(var(--hero-base-rotation))
      rotate(var(--hero-float-rotate));
  }

  50% {
    transform: translate3d(0, 0, 0) rotate(var(--hero-base-rotation));
  }

  75% {
    transform:
      translate3d(var(--hero-float-x-opposite), var(--hero-float-y), 0)
      rotate(var(--hero-base-rotation))
      rotate(var(--hero-float-rotate-opposite));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-icon,
  .hero-decor {
    translate: none;
    animation: none;
    transform: rotate(var(--hero-base-rotation));
    will-change: auto;
  }
}

.trust-strip {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: min(1000px, calc(100% - 48px));
  height: 72px;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  border-radius: var(--radius-3xl);
  background: var(--component-translucent-subtle);
}

.trust-strip__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  padding-inline: 24px;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

.trust-strip__item img {
  width: 18px;
  height: 18px;
}

.trust-strip .ui-separator--vertical {
  height: 16px;
}

.featured-section {
  height: 530px;
  padding-top: 40px;
}

.featured-panel {
  display: grid;
  height: 450px;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 40px;
  border-radius: var(--radius-5xl);
  background: var(--home-featured-surface);
}

.featured-panel__lead {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.featured-panel__lead h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-tight);
  line-height: var(--line-height-9);
}

.featured-panel__lead p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-5);
}

.featured-panel__controls {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

.featured-panel__cards {
  display: flex;
  min-width: 0;
  gap: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.featured-panel__cards::-webkit-scrollbar {
  display: none;
}

.featured-panel__cards .featured-card {
  scroll-snap-align: start;
}

.tool-section {
  padding-top: 40px;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.tool-section--two-rows { height: 476px; }
.tool-section--three-rows { height: 656px; }

.section-heading {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-tight);
  line-height: var(--line-height-9);
}

.section-heading__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.section-heading__link:hover {
  color: var(--text-primary);
}

.section-heading__link img {
  width: 16px;
  height: 16px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.search-status {
  min-height: 36px;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.search-results-mode .featured-section,
.search-results-mode .cta-section {
  display: none;
}

.search-results-mode .tool-section {
  height: auto;
  min-height: 0;
  padding-top: 48px;
}

.search-results-mode .tool-section[hidden] {
  display: none !important;
}

.search-results-mode .tool-section:last-of-type {
  padding-bottom: 80px;
}

.cta-section {
  height: 560px;
  padding-block: 80px;
}

.cta-panel {
  position: relative;
  display: flex;
  width: min(1200px, 100%);
  height: 400px;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  overflow: hidden;
  border-radius: var(--radius-5xl);
  background: #d7edff;
}

.cta-panel::before {
  position: absolute;
  inset: 0;
  background: url("../images/cta/cta-background.png") center / cover no-repeat;
  content: "";
}

.cta-panel__content {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100% - 48px));
  text-align: center;
}

.cta-panel h2 {
  margin: 0 0 12px;
  color: #0a0a0a;
  font-family: var(--font-display);
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-tighter);
  line-height: var(--line-height-15);
}

.cta-panel p {
  margin: 0 0 24px;
  color: #404040;
  font-size: var(--font-size-sm);
}

.site-footer {
  position: relative;
  height: 900px;
  overflow: hidden;
  color: rgb(255 255 255 / 64%);
  background: var(--home-footer-background);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #ffffff;
}

.site-footer__inner {
  position: relative;
  display: flex;
  width: min(calc(100% - 48px), var(--footer-max));
  height: 100%;
  margin-inline: auto;
  flex-direction: column;
  gap: 72px;
  padding-top: 72px;
}

.footer-main {
  display: flex;
  width: 100%;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 40px;
}

.footer-top {
  display: flex;
  width: 100%;
  height: 356px;
  gap: 64px;
}

.footer-intro {
  display: flex;
  width: 400px;
  flex: 0 0 400px;
  flex-direction: column;
  justify-content: space-between;
}

.footer-intro h2 {
  margin: 0;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: var(--font-weight-medium);
  line-height: normal;
}

.footer-links {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: space-between;
}

.footer-column {
  display: flex;
  min-width: 0;
  flex: 1 1 0;
  flex-direction: column;
  gap: 16px;
}

.footer-column h3 {
  width: 100%;
  margin: 0;
  padding: 4px 8px;
  color: var(--text-overlay-primary);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-5);
}

.footer-column__links {
  display: grid;
  gap: 8px;
}

.footer-column a {
  display: flex;
  width: 100%;
  height: 24px;
  align-items: center;
  gap: 4px;
  padding-inline: 8px;
  color: var(--text-overlay-secondary);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-4);
}

.footer-column__all-link img {
  width: 14px;
  height: 14px;
}

.footer-bottom {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 24px;
}

.footer-separator {
  width: 100%;
  height: 1px;
  background: rgb(255 255 255 / 20%);
}

.footer-meta {
  display: flex;
  min-height: 24px;
  align-items: center;
  gap: 16px;
  color: var(--text-overlay-secondary);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-4);
}

.footer-meta > a,
.footer-meta__copyright {
  display: flex;
  min-height: 24px;
  align-items: center;
  padding-inline: 8px;
}

.footer-meta__copyright {
  margin-left: auto;
}

.payment-list {
  display: flex;
  width: 264px;
  flex-wrap: wrap;
  align-content: flex-end;
  align-items: flex-end;
  gap: 16px;
}

.payment-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  overflow: hidden;
  place-items: center;
  border-radius: 6px;
}

.payment-icon--framed {
  border: 1px solid rgb(0 0 0 / 10%);
}

.payment-icon img {
  width: auto;
  height: auto;
  max-width: 24px;
  max-height: 24px;
  object-fit: contain;
}

.footer-wordmark {
  width: 100%;
  height: auto;
  flex: 0 0 auto;
  margin: 0;
}

@media (max-width: 1439px) {
  .site-header__inner {
    grid-template-columns: auto 1fr auto;
  }

  .primary-nav {
    justify-content: center;
  }

  .nav-link {
    padding-inline: var(--space-2xs);
  }

  .nav-link > img:not(.nav-link__chevron) {
    display: none;
  }

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

  .tool-section--two-rows,
  .tool-section--three-rows {
    height: auto;
    padding-bottom: 0;
  }

  .footer-top {
    gap: 40px;
  }

  .footer-intro {
    width: 320px;
    flex-basis: 320px;
  }
}

@media (max-width: 1120px) {
  .primary-nav,
  .header-actions > .header-desktop-only,
  .header-actions > .ui-separator--vertical {
    display: none;
  }

  .site-header__inner {
    display: flex;
    justify-content: space-between;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .hero-icon--04,
  .hero-icon--05,
  .hero-icon--06,
  .hero-icon--10,
  .hero-icon--14,
  .hero-icon--15 {
    display: none;
  }

  .hero-decor--arrow {
    top: 220px;
    left: clamp(24px, calc(50% - 416px), 120px);
    display: block;
    width: 110px;
  }

}

@media (max-width: 1023px) {
  .featured-panel {
    height: auto;
    grid-template-columns: 1fr;
  }

  .featured-panel__lead {
    display: flex;
  }

  .featured-panel__controls {
    margin-top: 24px;
  }

  .featured-section,
  .featured-panel {
    height: auto;
  }

  .featured-section {
    padding-bottom: 40px;
  }

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

  .footer-top {
    height: auto;
    flex-direction: column;
    gap: 48px;
  }

  .footer-intro {
    width: 100%;
    min-height: 112px;
    flex-basis: auto;
    flex-direction: row;
    align-items: flex-start;
    gap: 32px;
  }

  .site-footer {
    height: auto;
    min-height: 900px;
  }

  .site-footer__inner {
    height: auto;
  }

  .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
  }
}

@media (max-width: 767px) {
  .site-header__inner {
    padding-right: 12px;
    padding-left: 24px;
  }

  .header-actions .theme-toggle,
  .header-actions .language-button {
    display: none;
  }

  .brand-logo {
    width: auto;
  }

  .brand-logo__context {
    font-size: var(--font-size-xs);
    line-height: var(--line-height-4);
  }

  .hero {
    height: 560px;
  }

  .hero__content {
    width: calc(100% - 32px);
    padding-top: 150px;
  }

  .hero__title {
    font-size: 40px;
    line-height: 48px;
  }

  .hero__subtitle {
    width: min(310px, 100%);
    margin-top: 10px;
    font-size: var(--font-size-sm);
  }

  .hero-icon {
    width: 48px;
    height: 48px;
    padding: 10px;
    border-radius: 14px;
  }

  .hero-icon img {
    width: 28px;
    height: 28px;
  }

  .hero-icon--01 { top: 400px; left: auto; right: 32px; }
  .hero-icon--02 { top: 84px; left: auto; right: 48px; }
  .hero-icon--03 { top: 92px; left: 26px; }
  .hero-icon--07 { top: 405px; left: 24px; }
  .hero-icon--08,
  .hero-icon--09,
  .hero-icon--11,
  .hero-icon--12,
  .hero-icon--13,
  .hero-icon--16,
  .hero-decor--orbit,
  .hero-decor--pen {
    display: none;
  }

  .hero-decor--arrow {
    top: 325px;
    left: 8px;
    display: block;
    width: 76px;
  }

  .trust-strip {
    width: 100%;
    height: 84px;
    padding: 14px 16px;
    flex-wrap: wrap;
    border-radius: var(--radius-3xl);
  }

  .trust-strip__item {
    padding-inline: 8px;
    font-size: var(--font-size-xs);
  }

  .trust-strip .ui-separator--vertical {
    display: none;
  }

  .featured-section {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .featured-panel {
    gap: 24px;
    padding: 24px;
    border-radius: var(--radius-4xl);
  }

  .featured-panel__lead h2,
  .section-heading h2 {
    font-size: var(--font-size-2xl);
    line-height: var(--line-height-8);
  }

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

  .tool-section {
    height: auto;
    padding-top: 56px;
  }

  .tool-card {
    gap: var(--space-md);
    padding: var(--space-md);
  }

  .cta-section {
    height: 440px;
    padding-block: 56px;
  }

  .cta-panel {
    height: 328px;
    border-radius: var(--radius-4xl);
  }

  .cta-panel h2 {
    font-size: 36px;
    line-height: 44px;
  }

  .site-footer {
    height: auto;
    min-height: 0;
  }

  .site-footer__inner {
    width: calc(100% - 48px);
    height: auto;
    gap: 56px;
    padding-top: 56px;
  }

  .footer-top {
    gap: 40px;
  }

  .footer-intro {
    min-height: 136px;
    flex-direction: column;
  }

  .footer-meta {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .footer-links {
    grid-template-columns: 1fr;
  }

  .footer-meta__copyright {
    width: 100%;
    margin-left: 0;
  }

  .footer-wordmark {
    margin-bottom: -8px;
  }
}

@media (max-width: 420px) {
  .header-actions .ui-button--primary {
    padding-inline: 12px;
  }
}
