html,
body {
  min-height: 100%;
}
body {
  display: flex;
  flex-direction: column;
}
main {
  width: 100%;
  flex: 1;
}
a {
  color: var(--color-text);
  text-decoration: none;
}
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.search-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  min-height: 64px;
  padding: 16px 24px;
  border-bottom: 2px solid var(--color-divider);
}
.back-link {
  justify-self: start;
  font-size: 13px;
  font-weight: 600;
}
.back-link:hover,
.race-heading a:hover {
  color: var(--color-accent-700);
}
.wordmark {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.languages {
  justify-self: end;
  display: flex;
  gap: 14px;
}
.langbtn {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: var(--color-neutral-700);
  font: 600 13px var(--font-heading);
  letter-spacing: 0.12em;
}
.langbtn.active,
.langbtn:hover {
  color: var(--color-accent-700);
}

.search-hero {
  padding: 56px 24px 48px;
  border-bottom: 2px solid var(--color-divider);
}
.kicker {
  color: var(--color-accent-700);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.search-hero h1 {
  margin: 14px 0 18px;
  font-size: clamp(44px, 9vw, 100px);
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.search-hero p {
  max-width: 58ch;
  margin: 0;
  color: var(--color-neutral-700);
  line-height: 1.5;
}

.search-workspace {
  max-width: 940px;
  margin: 0 auto;
  padding: 42px 24px 52px;
}
.search-workspace h2 {
  margin: 0 0 24px;
  font-size: clamp(24px, 4vw, 36px);
}
.search-workspace label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}
.search-controls {
  display: flex;
  min-height: 64px;
}
.search-controls input {
  width: 100%;
  min-width: 0;
  padding: 16px 18px;
  border: 2px solid var(--color-text);
  border-right: 0;
  border-radius: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: 500 18px var(--font-body);
}
.search-controls input::placeholder {
  color: var(--color-neutral-700);
}
.search-controls button {
  flex: none;
  min-width: 130px;
  padding: 14px 20px;
  border: 2px solid var(--color-text);
  background: var(--color-text);
  color: var(--color-bg);
  font: 600 15px var(--font-body);
  cursor: pointer;
}
.search-controls button:hover:not(:disabled) {
  background: var(--color-accent-700);
  border-color: var(--color-accent-700);
}
.search-controls button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.search-status {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--color-neutral-700);
  font-size: 13px;
}
.suggestions {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 2px solid var(--color-divider);
  border-top: 0;
}
.suggestions[hidden],
.rider-result[hidden] {
  display: none;
}
.suggestion {
  width: 100%;
  padding: 13px 18px;
  border: 0;
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-bg);
  color: var(--color-text);
  text-align: left;
  font: 600 15px var(--font-body);
  cursor: pointer;
}
.suggestions li:last-child .suggestion {
  border-bottom: 0;
}
.suggestion:hover,
.suggestion:focus-visible {
  background: var(--color-accent-100);
}

.rider-result {
  border-top: 2px solid var(--color-divider);
}
.rider-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 36px 24px;
  background: var(--color-surface);
}
.rider-title h2 {
  margin: 10px 0 0;
  font-size: clamp(30px, 6vw, 56px);
  line-height: 1;
}
.rider-title > span {
  padding-bottom: 5px;
  color: var(--color-neutral-700);
  font-size: 14px;
}
.race-result {
  padding: 28px 24px 40px;
  border-top: 2px solid var(--color-divider);
}
.race-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
}
.race-heading h3 {
  margin: 0;
  font-size: clamp(23px, 4vw, 34px);
}
.race-heading a {
  color: var(--color-accent-700);
  font-size: 13px;
  font-weight: 700;
}
.race-summary {
  margin: 12px 0 24px;
  color: var(--color-neutral-700);
  font-size: 14px;
}
.stage-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.stage-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.stage-table th {
  padding: 12px 14px;
  border-top: 2px solid var(--color-text);
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-neutral-700);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.stage-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--color-divider);
  font-size: 14px;
}
.stage-table th:nth-child(2),
.stage-table td:nth-child(2) {
  width: 25%;
}
.stage-table th:nth-child(3),
.stage-table td:nth-child(3) {
  width: 35%;
}
.data-note,
.empty-stages {
  color: var(--color-neutral-700);
  font-size: 13px;
  line-height: 1.5;
}
.data-note {
  margin: 14px 0 0;
}
.empty-stages {
  margin: 0;
  padding: 20px;
  background: var(--color-surface);
}
.search-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 24px 40px;
  border-top: 2px solid var(--color-divider);
}
.search-footer > span:first-child {
  color: var(--color-neutral-700);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.footer-year {
  color: var(--color-accent);
  font-size: clamp(40px, 8vw, 88px);
  font-weight: 700;
  line-height: 0.85;
}
.no-script {
  margin: 24px;
}

@media (max-width: 600px) {
  .search-header {
    grid-template-columns: 1fr auto;
  }
  .wordmark {
    display: none;
  }
  .search-hero {
    padding: 42px 24px 36px;
  }
  .search-workspace {
    padding-block: 34px 42px;
  }
  .search-controls button {
    min-width: 98px;
    padding-inline: 12px;
  }
  .search-controls input {
    font-size: 16px;
  }
}
