:root {
  --ink: #14213d;
  --surface: #ffffff;
  --surface-line: rgba(20, 33, 61, 0.16);
  --accent: #75cdf3;
  --accent-rgb: 117, 205, 243;
  --landing-search-height: clamp(2.8rem, 6vh, 3.7rem);
  --landing-lockup-gap: clamp(1rem, 2.8vh, 1.7rem);
  --results-content-width: min(96vw, 78rem);
  --results-logo-slot: clamp(6.6rem, 8vw, 8.6rem);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #ffffff;
}

.landing-page {
  min-height: 100dvh;
}

.landing {
  min-height: 100dvh;
  width: min(92vw, 56rem);
  margin: 0 auto;
  padding: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(0.9rem, 2.2vh, 1.5rem);
}

.landing-page .landing {
  position: relative;
  display: block;
}

.logo-stack {
  text-align: center;
  width: 100%;
  display: grid;
  justify-items: center;
}

.landing-page .logo-stack {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100%, clamp(18rem, 78vw, 44rem));
  /* Keep logo above the centered search bar by a stable gap, independent of logo height. */
  transform: translate(-50%, calc(-100% - (var(--landing-search-height) / 2) - var(--landing-lockup-gap)));
}

.logo-image {
  display: block;
  width: clamp(10rem, 30vw, 22rem);
  height: auto;
  max-width: 100%;
}

.landing-page .logo-image {
  width: clamp(14rem, 42vw, 32rem);
}

.logo-image-small {
  width: clamp(2rem, 5vw, 3rem);
}

.search-form {
  width: min(100%, clamp(18rem, 78vw, 44rem));
  position: relative;
}

.landing-page .search-form {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.search-input {
  width: 100%;
  height: var(--landing-search-height);
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  padding: 0 clamp(0.85rem, 2.8vw, 1.25rem);
  padding-right: clamp(2.3rem, 4.6vw, 3rem);
  font-size: clamp(0.95rem, 1.9vw, 1.15rem);
  background: var(--surface);
  box-shadow: 0 10px 22px rgba(20, 33, 61, 0.08);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px rgba(var(--accent-rgb), 0.3),
    0 16px 26px rgba(20, 33, 61, 0.1);
}

.search-submit {
  position: absolute;
  right: clamp(0.62rem, 1.5vw, 0.95rem);
  top: 50%;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(20, 33, 61, 0.62);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-submit:hover {
  color: var(--accent);
}

.search-submit:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.75);
  outline-offset: 2px;
}

.search-submit-icon {
  width: 1.05rem;
  height: 1.05rem;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.results-shell {
  width: var(--results-content-width);
  margin: 0 auto;
  padding: clamp(4.8rem, 10.8vh, 6.5rem) 0 clamp(2rem, 4.5vh, 3.2rem);
  animation: fade-in 260ms ease-out both;
}

.results-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: #ffffff;
  border-bottom: 1px solid rgba(20, 33, 61, 0.12);
}

.results-header-inner {
  width: var(--results-content-width);
  margin: 0 auto;
  padding: clamp(0.52rem, 1.2vh, 0.75rem) 0;
  display: flex;
  align-items: center;
  gap: clamp(0.65rem, 1.6vw, 1rem);
}

.home-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.results-search-form {
  flex: 1 1 auto;
  width: auto;
  margin: 0;
}

.results-block {
  padding-top: clamp(0.52rem, 1.6vh, 0.95rem);
}

.results-count {
  margin: 0 0 0.2rem;
  color: rgba(20, 33, 61, 0.72);
  font-size: clamp(0.83rem, 1.4vw, 0.96rem);
}

.results-timing {
  margin: 0 0 clamp(0.72rem, 1.9vh, 1.1rem);
  color: rgba(20, 33, 61, 0.72);
  font-size: clamp(0.83rem, 1.4vw, 0.96rem);
}

.results-feedback {
  margin: 0 0 clamp(0.9rem, 2vh, 1.2rem);
  padding: clamp(0.65rem, 1.7vh, 0.9rem) clamp(0.8rem, 2.1vw, 1rem);
  border-radius: 0.7rem;
  border: 1px solid rgba(154, 18, 40, 0.28);
  background: rgba(185, 31, 60, 0.08);
  color: #7a0f23;
  font-size: clamp(0.86rem, 1.5vw, 0.95rem);
  line-height: 1.4;
}

.results-feedback.is-info {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.15);
  color: #105d7e;
}

.results-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.results-pagination {
  margin-top: clamp(1rem, 2.4vh, 1.5rem);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  height: 2.05rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(20, 33, 61, 0.15);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1;
  background: #fff;
}

.pagination-link:hover {
  border-color: rgba(20, 33, 61, 0.28);
  background: rgba(20, 33, 61, 0.04);
}

.pagination-link.is-current {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.pagination-link.is-disabled {
  opacity: 0.45;
}

.pagination-gap {
  color: rgba(20, 33, 61, 0.65);
  font-size: 0.92rem;
  padding: 0 0.25rem;
}

.result-card {
  padding: clamp(0.68rem, 1.65vh, 1rem) 0;
  border-bottom: 1px solid rgba(20, 33, 61, 0.11);
  opacity: 0;
  transform: translateY(8px);
  animation: rise-in 360ms ease-out forwards;
}

.result-card:nth-child(1) {
  animation-delay: 40ms;
}
.result-card:nth-child(2) {
  animation-delay: 95ms;
}
.result-card:nth-child(3) {
  animation-delay: 150ms;
}
.result-card:nth-child(4) {
  animation-delay: 205ms;
}
.result-card:nth-child(5) {
  animation-delay: 260ms;
}

.result-url {
  font-size: clamp(0.8rem, 1.4vw, 0.94rem);
  color: rgba(20, 33, 61, 0.78);
  text-decoration: none;
}

.result-url:hover {
  text-decoration: underline;
}

.result-title {
  margin: 0.2rem 0 0.25rem;
  font-size: clamp(1rem, 2.1vw, 1.35rem);
  font-weight: 650;
  line-height: 1.2;
}

.result-title a {
  text-decoration: none;
  color: #0f3d8a;
}

.result-title a:hover {
  text-decoration: underline;
}

.result-snippet {
  margin: 0;
  color: rgba(20, 33, 61, 0.82);
  font-size: clamp(0.9rem, 1.6vw, 1rem);
  line-height: 1.45;
  max-width: 75ch;
}

.result-meta {
  margin: 0.4rem 0 0;
  color: rgba(20, 33, 61, 0.68);
  font-size: clamp(0.78rem, 1.3vw, 0.88rem);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@media (max-width: 640px) {
  .results-header-inner {
    gap: 0.55rem;
  }

  .results-search-form {
    flex: 1 1 auto;
  }
}
