/* Homepage experience layer. Kept separate so the wider site can adopt it gradually. */
:root {
  --home-radius-sm: 10px;
  --home-radius: 16px;
  --home-radius-lg: 24px;
  --home-shadow: 0 18px 55px rgba(26, 55, 47, 0.09);
  --home-shadow-hover: 0 24px 70px rgba(26, 55, 47, 0.14);
}

:root[data-theme="dark"] {
  --home-shadow: 0 18px 55px rgba(0, 0, 0, 0.24);
  --home-shadow-hover: 0 24px 70px rgba(0, 0, 0, 0.34);
}

body {
  background:
    radial-gradient(circle at 8% -10%, color-mix(in srgb, var(--teal) 14%, transparent), transparent 32rem),
    var(--bg);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 8% -10%, color-mix(in srgb, var(--teal) 16%, transparent), transparent 32rem),
    var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  max-width: none;
  padding: 14px max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(18px);
}

.brand img {
  width: 42px;
  height: 42px;
}

.nav a,
.theme-button,
.tools-menu summary {
  min-height: 44px;
  border-radius: var(--home-radius-sm);
}

.tools-panel {
  border-radius: var(--home-radius);
  box-shadow: var(--home-shadow-hover);
}

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
  min-height: 0;
  padding-top: clamp(36px, 5vw, 64px);
  padding-bottom: clamp(48px, 7vw, 88px);
}

.hero::before,
.hero-copy::before {
  display: none;
}

.hero-copy {
  max-width: none;
  position: sticky;
  top: 92px;
  gap: 18px;
}

.hero-eyebrow {
  margin: 0;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(42px, 5.4vw, 68px);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.hero-copy > p:not(.hero-eyebrow) {
  max-width: 38ch;
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
}

.tool-finder {
  position: relative;
  z-index: 4;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--home-radius);
  background: var(--paper);
  box-shadow: none;
}

.hero-tool-board {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 12px;
}

.hero-tool-board a {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--home-radius);
  background: var(--paper);
  color: var(--ink);
  padding: 16px;
  text-decoration: none;
  box-shadow: var(--home-shadow);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.hero-tool-board a:hover,
.hero-tool-board a:focus-visible {
  border-color: color-mix(in srgb, var(--teal) 48%, var(--line));
  transform: translateY(-2px);
  box-shadow: var(--home-shadow-hover);
  outline: none;
}

.hero-tool-board a strong,
.hero-tool-board a span {
  display: block;
}

.hero-tool-board a strong {
  font-size: 16px;
  line-height: 1.2;
}

.hero-tool-board a > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.hero-featured {
  grid-column: 1;
  grid-row: 1 / span 4;
  align-self: stretch;
  align-content: space-between;
  padding: 22px;
  border-color: color-mix(in srgb, var(--teal) 38%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--teal) 10%, var(--paper)), var(--paper) 42%);
}

.hero-kicker,
.hero-cta {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-featured strong {
  font-size: clamp(28px, 3vw, 36px);
  letter-spacing: -0.04em;
}

.hero-featured-copy {
  max-width: 36ch;
}

.hero-example {
  display: grid;
  gap: 4px;
  margin: 8px 0 4px;
  border: 1px solid color-mix(in srgb, var(--teal) 22%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  padding: 14px;
}

.hero-example span,
.hero-example small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.hero-example b {
  color: var(--ink);
  font-size: clamp(34px, 4vw, 46px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero-cta {
  align-self: end;
  margin-top: auto;
  padding-top: 12px;
}

.hero-cta::after {
  content: " →";
}

.calculator-preview {
  display: none;
}

.tool-finder > label {
  display: block;
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 820;
}

.tool-search-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 58px;
  border: 2px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  padding: 0 10px 0 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.tool-search-row:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px var(--accent-wash);
}

.tool-search-icon {
  position: relative;
  width: 17px;
  height: 17px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.tool-search-icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: var(--muted);
  transform: rotate(45deg);
}

.tool-search-row input {
  width: 100%;
  min-height: 54px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 12px;
  font-size: 16px;
}

.tool-search-row button {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: var(--soft);
  color: var(--teal-dark);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.tool-search-hint,
.tool-search-status {
  margin: 9px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.tool-search-status:empty {
  display: none;
}

.tool-search-results {
  position: absolute;
  top: calc(100% - 8px);
  right: 18px;
  left: 18px;
  max-height: min(430px, 62vh);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--home-radius) var(--home-radius);
  background: var(--paper);
  box-shadow: var(--home-shadow-hover);
  padding: 8px;
}

.tool-search-results a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  border-radius: var(--home-radius-sm);
  padding: 12px;
  color: var(--ink);
  text-decoration: none;
}

.tool-search-results a:hover,
.tool-search-results a:focus-visible {
  background: var(--soft);
  outline: none;
}

.tool-search-results strong,
.tool-search-results span,
.tool-search-results small {
  min-width: 0;
}

.tool-search-results strong {
  font-size: 14px;
}

.tool-search-results span {
  grid-column: 1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.tool-search-results small {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 760;
}

.tool-search-empty {
  margin: 0;
  padding: 20px 14px;
  color: var(--muted);
  text-align: center;
}

.category-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.category-shortcuts a {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  color: var(--muted);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
}

.category-shortcuts a:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.hero-actions,
.hero-tool-link,
.hero-points,
.calculator-preview {
  display: none;
}

.section {
  padding-top: clamp(64px, 8vw, 104px);
  padding-bottom: clamp(64px, 8vw, 104px);
}

.section-heading h2 {
  max-width: 18ch;
  font-size: clamp(32px, 4.4vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.popular-pay-tools,
.tool-category,
.guide-card,
.faq-item,
.feedback-band {
  border-radius: var(--home-radius);
}

.tool-category {
  scroll-margin-top: 92px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.tool-category:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--teal) 34%, var(--line));
  box-shadow: var(--home-shadow);
}

.tool-link-list a,
.popular-pay-grid a,
.guide-card a {
  border-radius: var(--home-radius-sm);
}

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    position: static;
  }

  .hero-copy h1 {
    max-width: 14ch;
  }

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

  .hero-featured {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-copy,
  .hero-copy > p:not(.hero-eyebrow) {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 10px 16px;
  }

  .brand > span > span,
  .nav > a {
    display: none;
  }

  .hero {
    width: min(100% - 28px, 1180px);
    padding-top: 42px;
    padding-bottom: 56px;
  }

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

  .hero-copy > p:not(.hero-eyebrow) {
    margin-top: 18px;
    font-size: 17px;
  }

  .tool-finder {
    margin-top: 24px;
    padding: 12px;
  }

  .tool-search-results {
    right: 12px;
    left: 12px;
  }

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

  .tool-search-results small {
    grid-column: 1;
    grid-row: auto;
  }

  .category-shortcuts {
    flex-wrap: nowrap;
    margin-right: -14px;
    padding-right: 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .category-shortcuts::-webkit-scrollbar {
    display: none;
  }

  .category-shortcuts a {
    flex: 0 0 auto;
  }

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

  .hero-actions,
  .calculator-preview {
    display: none;
  }

  .section {
    width: min(100% - 28px, 1180px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-category {
    transition: none;
  }
}

.home-saved-tools {
  display: grid;
  grid-template-columns: minmax(210px, .55fr) minmax(0, 1.45fr);
  gap: 18px;
  align-items: start;
  margin: 24px 0;
  border: 1px solid color-mix(in srgb, var(--teal) 30%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--teal) 6%, var(--paper));
  padding: 18px;
}

.home-saved-tools h2,
.home-saved-tools p {
  margin: 0;
}

.home-saved-tools h2 {
  font-size: clamp(22px, 3vw, 30px);
}

.home-saved-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-saved-grid a {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  padding: 13px;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.home-saved-grid a:hover,
.home-saved-grid a:focus-visible {
  border-color: var(--teal);
  transform: translateY(-1px);
}

.home-saved-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .home-saved-tools,
  .home-saved-grid {
    grid-template-columns: 1fr;
  }
}
