/* Global foundations */

:root {
  --bg: #f6f7f8;
  --page-background: linear-gradient(180deg, #fbfcfd 0%, var(--bg) 46%, #eef0f2 100%);
  --hero-title-gradient: linear-gradient(105deg, #6f92e8 0%, #976ce8 38%, #d35fd2 70%, #f08a82 100%);
  --surface: #ffffff;
  --surface-soft: #fbfbfc;
  --text: #1d2520;
  --muted: #6b756f;
  --line: #e0e4e7;
  --primary: #27735f;
  --shadow: 0 18px 45px rgba(37, 53, 46, 0.10);
  --page-card-gap: 28px;
  --records-card-overlap: 24px;
  --section-card-heading-size: clamp(1.6rem, 2.6vw, 2.2rem);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --font-display: "SF Pro Rounded", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

html[data-page="reaction"] {
  --brand: #6b65dc;
  --nav-brand-letter-spacing: 0;
  --nav-header-z-index: 20;
  --nav-menu-z-index: 30;
  --footer-link-mobile-padding: 4px 0;
}

html[data-page="spacebar"] {
  --surface-soft: #fbfdff;
  --text: #172a3b;
  --muted: #65706b;
  --line: #e2e8ee;
  --brand: #6b65dc;
  --shadow: 0 18px 45px rgba(23, 42, 59, 0.10);
}

html[data-page="coreball"] {
  --brand: #5b5ff4;
  --nav-brand-letter-spacing: 0;
  --nav-font-weight: 700;
  --nav-mobile-font-size: 0.86rem;
  --nav-header-z-index: 20;
  --nav-language-color: var(--muted);
  --nav-language-background: transparent;
  --nav-language-width: 38px;
  --nav-language-min-height: 38px;
  --nav-menu-z-index: 30;
  --nav-menu-min-width: 128px;
  --nav-menu-padding: 8px;
  --nav-menu-border: 1px solid rgba(23, 42, 59, 0.08);
  --nav-menu-shadow: 0 16px 34px rgba(35, 55, 72, 0.12);
  --nav-menu-link-font-size: 0.9rem;
  --nav-menu-link-font-weight: 750;
  --footer-margin-bottom: 22px;
  --footer-inner-padding: 14px clamp(20px, 3vw, 40px);
  --footer-mobile-inner-padding: 14px clamp(16px, 4vw, 20px);
  --footer-mobile-gap: 10px;
  --footer-link-mobile-padding: 4px 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

#popular-tests,
#score-records,
#features,
#guide,
#faq,
#score-levels,
#about,
#privacy-policy,
#disclaimer {
  scroll-margin-top: 92px;
}

body {
  margin: 0;
  touch-action: manipulation;
  color: var(--text);
  background: var(--page-background);
  font-family: var(--font-sans);
  line-height: 1.6;
}

html[data-page="reaction"],
html[data-page="coreball"],
html[data-page="reaction"] body,
html[data-page="coreball"] body {
  min-height: 100%;
}

html[data-page="spacebar"] {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html[data-page="spacebar"] body {
  width: 100%;
  max-width: min(100%, var(--spacebar-visible-width, 100%));
  min-height: 100vh;
  overflow-x: hidden;
}

html[data-page="spacebar"] main > * {
  min-width: 0;
  max-width: 100%;
}

html[data-page="coreball"] main {
  padding-bottom: 10px;
}

button,
a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

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

/* Shared navigation */

:root {
  --nav-brand-color: var(--brand, #6b65dc);
  --nav-brand-letter-spacing: -0.02em;
  --nav-text-color: var(--muted, #6b756f);
  --nav-hover-color: var(--text, #1d2520);
  --nav-font-weight: 650;
  --nav-mobile-font-size: 0.95rem;
  --nav-header-z-index: 10;
  --nav-language-color: #172a3b;
  --nav-language-background: #f5f8fb;
  --nav-language-width: auto;
  --nav-language-min-height: auto;
  --nav-menu-z-index: 20;
  --nav-menu-min-width: 132px;
  --nav-menu-padding: 6px;
  --nav-menu-border: 0;
  --nav-menu-shadow: 0 18px 42px rgba(23, 42, 59, 0.13);
  --nav-menu-link-font-size: 0.84rem;
  --nav-menu-link-font-weight: 800;
  --nav-focus-color: rgba(107, 101, 220, 0.25);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--nav-header-z-index);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: min(1200px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  gap: 10px;
}

.brand {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  color: #07172f;
  font-family: var(--font-display);
  font-size: clamp(1.24rem, 2vw, 1.72rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: var(--nav-brand-letter-spacing);
  white-space: nowrap;
}

.brand-name {
  display: inline-block;
}

.brand-tld {
  display: inline-flex;
  align-items: center;
  min-height: 1.1em;
  margin-left: 0.08em;
  padding: 0.05em 0.23em 0.09em;
  color: #ffffff;
  background: var(--nav-brand-color);
  border-radius: 0.34em;
  line-height: 0.96;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
  color: var(--nav-text-color);
  font-size: 0.95rem;
  font-weight: var(--nav-font-weight);
}

.nav-links a {
  border-radius: 999px;
  padding: 8px 10px;
  transition: background-color 180ms ease, color 180ms ease;
}

.nav-links a:hover {
  color: var(--nav-hover-color);
  background: #eef1f3;
}

.nav-link-new {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.new-badge {
  position: absolute;
  top: -5px;
  right: -8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 15px;
  padding: 0 5px;
  color: #ffffff;
  background: #f04438;
  border-radius: 6px;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: none;
  filter: drop-shadow(0 3px 4px rgba(190, 35, 35, 0.24));
  pointer-events: none;
  animation: nav-new-badge-float 2.2s ease-in-out infinite;
}

.new-badge::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 8px;
  width: 0;
  height: 0;
  border-top: 5px solid #f04438;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.language-switcher {
  position: relative;
  flex: 0 0 auto;
}

.language-switcher summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--nav-language-width);
  min-height: var(--nav-language-min-height);
  padding: 7px;
  color: var(--nav-language-color);
  background: var(--nav-language-background);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.language-switcher summary::-webkit-details-marker {
  display: none;
}

.language-switcher summary::marker {
  content: "";
}

.language-switcher summary:hover,
.language-switcher[open] summary {
  color: #172a3b;
  background: #eef3ff;
  box-shadow: 0 10px 24px rgba(93, 110, 219, 0.12);
}

.language-switcher summary svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.language-symbol {
  width: 21px;
  height: 21px;
  stroke-width: 2;
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: var(--nav-menu-z-index);
  display: grid;
  min-width: var(--nav-menu-min-width);
  padding: var(--nav-menu-padding);
  background: #ffffff;
  border: var(--nav-menu-border);
  border-radius: 14px;
  box-shadow: var(--nav-menu-shadow);
  transform-origin: top right;
}

.language-switcher.has-menu-animation > .language-menu {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
}

.language-menu.is-entering {
  animation: nav-language-menu-enter 320ms ease both;
}

.language-menu a {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 10px;
  color: var(--nav-text-color);
  border-radius: 10px;
  font-size: var(--nav-menu-link-font-size);
  font-weight: var(--nav-menu-link-font-weight);
  line-height: 1;
  white-space: nowrap;
  transition: background-color 180ms ease, color 180ms ease;
}

.language-menu a:hover,
.language-menu a[aria-current="page"] {
  color: #172a3b;
  background: #eef3ff;
}

.nav-links a:focus-visible,
.language-switcher summary:focus-visible,
.language-menu a:focus-visible,
.brand-lockup:focus-visible {
  outline: 3px solid var(--nav-focus-color);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .language-switcher::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 0;
    z-index: var(--nav-menu-z-index);
    width: var(--nav-menu-min-width);
    height: 8px;
    background: transparent;
    pointer-events: auto;
  }

  .language-switcher > .language-menu {
    display: none;
  }

  .language-switcher[open] > .language-menu,
  .language-switcher summary:focus-visible + .language-menu,
  .language-switcher > .language-menu:focus-within {
    display: grid;
  }

  .language-switcher[open]:not(:hover) summary:not(:focus-visible) {
    color: var(--nav-language-color);
    background: var(--nav-language-background);
    box-shadow: none;
  }
}

@keyframes nav-new-badge-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

@keyframes nav-language-menu-enter {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 760px) {
  .navbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: auto;
    padding: 10px 0;
    align-items: center;
    gap: 8px;
  }

  .brand-lockup {
    font-size: clamp(0.98rem, 4vw, 1.14rem);
  }

  .brand-tld {
    padding: 0.04em 0.18em 0.08em;
    border-radius: 0.28em;
  }

  .nav-links {
    grid-column: 2 / 3;
    min-width: 0;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    flex-wrap: nowrap;
    white-space: nowrap;
    padding: 2px 0;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
    font-size: var(--nav-mobile-font-size);
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    flex: 0 0 auto;
  }

  .language-switcher {
    grid-column: 3 / 4;
    align-self: center;
    justify-self: end;
  }

  .language-switcher summary {
    width: 34px;
    min-height: 32px;
    padding: 5px;
  }

  .language-symbol {
    width: 17px;
    height: 17px;
  }
}

@media (max-width: 560px) {
  .nav-links {
    align-content: center;
  }

  .language-switcher {
    align-self: center;
    justify-self: end;
  }

  .language-menu {
    right: 0;
  }
}

@media (max-width: 460px) {
  .navbar {
    width: min(100% - 22px, 1200px);
  }

  .nav-links {
    gap: 4px;
    font-size: 0.86rem;
  }

  .nav-links a {
    flex: 0 0 auto;
    padding: 7px 9px;
  }

  .language-switcher summary {
    width: 32px;
    min-height: 30px;
    padding: 5px;
    font-size: 0.76rem;
  }

  .language-symbol {
    width: 16px;
    height: 16px;
  }

  .language-menu a {
    min-height: 30px;
    padding: 6px 8px;
    font-size: 0.78rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .new-badge,
  .language-menu.is-entering {
    animation: none;
  }

  .language-switcher.has-menu-animation > .language-menu {
    opacity: 1;
    transform: none;
  }
}


/* Shared page hero */

.hero {
  --page-hero-padding: clamp(34px, 4vw, 46px) clamp(18px, 5vw, 64px) clamp(28px, 3vw, 36px);
  position: relative;
  overflow: hidden;
  width: min(var(--page-hero-max-width, 1200px), calc(100% - 32px));
  margin: var(--page-card-gap) auto 0;
  padding: var(--page-hero-padding);
  text-align: center;
  background: var(--page-hero-background, #ffffff);
  border: 0;
  border-radius: var(--page-hero-radius, 32px);
}

html[data-page="reaction"] .hero {
  --page-hero-max-width: 1200px;
  --page-hero-title-gap: 8px;
  --page-hero-title-background: var(--hero-title-gradient);
  --page-hero-copy-max-width: min(860px, 100%);
  --page-hero-copy-white-space: normal;
}

html[data-page="spacebar"] .hero,
html[data-page="coreball"] .hero {
  --page-hero-background: var(--surface);
}

.hero > * {
  position: relative;
}

.hero-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--page-hero-title-gap, 14px);
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.hero #page-title {
  flex: 0 1 auto;
  max-width: 100%;
  margin: 0;
  color: transparent;
  background-image: var(
    --page-hero-title-background,
    var(--hero-title-gradient)
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.6vw, 4.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0;
  text-shadow: 0 10px 24px rgba(107, 101, 220, 0.12);
  white-space: normal;
  padding-bottom: 0.1em;
}

.hero #page-title span {
  display: inline-block;
}

.hero #page-title > .title-cps,
.hero #page-title > .title-test {
  text-shadow: none;
  filter:
    drop-shadow(0 3px 2px rgba(74, 65, 160, 0.14))
    drop-shadow(0 8px 10px rgba(89, 82, 179, 0.06));
}

.hero #page-title.is-segmented-title {
  background-image: none;
}

.hero #page-title.is-segmented-title > span {
  color: transparent;
  background-image:
    linear-gradient(
      100deg,
      transparent 38%,
      rgba(255, 255, 255, 0.08) 45%,
      rgba(255, 255, 255, 0.42) 50%,
      rgba(255, 255, 255, 0.08) 55%,
      transparent 62%
    ),
    var(
      --page-hero-title-background,
      var(--hero-title-gradient)
    );
  background-repeat: no-repeat;
  background-position:
    calc(var(--hero-title-background-x, 0px) - var(--hero-title-background-width, 100%))
      var(--hero-title-background-y, 0),
    var(--hero-title-background-x, 0) var(--hero-title-background-y, 0);
  background-size:
    var(--hero-title-background-width, 100%)
      var(--hero-title-background-height, 100%),
    var(--hero-title-background-width, 100%)
      var(--hero-title-background-height, 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hero-title-shine 5600ms cubic-bezier(0.45, 0, 0.55, 1) 680ms infinite both;
}

@keyframes hero-title-shine {
  from {
    background-position:
      calc(var(--hero-title-background-x, 0px) - var(--hero-title-background-width, 100%))
        var(--hero-title-background-y, 0),
      var(--hero-title-background-x, 0) var(--hero-title-background-y, 0);
  }

  to {
    background-position:
      calc(var(--hero-title-background-x, 0px) + var(--hero-title-background-width, 100%))
        var(--hero-title-background-y, 0),
      var(--hero-title-background-x, 0) var(--hero-title-background-y, 0);
  }
}

.hero-copy {
  display: inline-block;
  max-width: var(--page-hero-copy-max-width, min(900px, 100%));
  margin: 14px auto 0;
  color: #536071;
  font-family: var(
    --font-sans,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "SF Pro Display",
    "Helvetica Neue",
    Arial,
    sans-serif
  );
  font-size: clamp(0.96rem, 1.35vw, 1.08rem);
  font-weight: 700;
  line-height: 1.45;
  white-space: var(--page-hero-copy-white-space, nowrap);
  transform: none;
}

.hero--clean-title {
  isolation: isolate;
  background: #ffffff;
}

.hero-clean-title-content {
  z-index: 2;
  width: min(930px, 88%);
  margin: 0 auto;
  text-align: center;
}

.hero-clean-title-copy {
  display: block;
  max-width: min(900px, 100%);
  margin-right: auto;
  margin-left: auto;
  color: #536071;
  white-space: normal;
}

.hero-copy-accent {
  display: inline-block;
  padding-bottom: 0.2em;
  background-repeat: no-repeat;
  background-position: center calc(100% - 0.01em);
  background-size: 100% 0.42em;
  white-space: nowrap;
}

.hero-copy-accent--blue {
  background-image: url("../images/decorations/underline-soft-blue.svg?v=2");
}

.hero-copy-accent--violet {
  background-image: url("../images/decorations/underline-soft-violet.svg?v=2");
}

@media (min-width: 900px) {
  .hero-title-row {
    flex-wrap: nowrap;
  }

  .hero #page-title {
    white-space: nowrap;
  }

}

@media (max-width: 899px) {
  html[data-page="cps"] .hero--clean-title::after {
    display: none;
  }
}

@media (max-width: 760px) {
  .hero-title-row {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .hero #page-title {
    white-space: normal;
  }

  .hero #page-title.is-long-ja-title {
    font-size: clamp(1.85rem, 8vw, 2.5rem);
  }

  .hero-copy {
    display: block;
    max-width: min(100%, 680px);
    margin-top: 10px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }

}

@media (max-width: 620px) {
  .hero-clean-title-content {
    width: 94%;
  }

  .hero-clean-title-copy {
    max-width: 94%;
    margin-top: 10px;
  }
}

@media (max-width: 460px) {
  .hero #page-title {
    font-size: clamp(2.2rem, 10vw, 2.8rem);
  }

  .hero #page-title > .title-cps,
  .hero #page-title > .title-test {
    filter:
      drop-shadow(0 2px 1.5px rgba(74, 65, 160, 0.12))
      drop-shadow(0 6px 7px rgba(89, 82, 179, 0.05));
  }

  .hero-copy {
    max-width: 100%;
    margin-top: 10px;
    font-size: clamp(0.9rem, 4vw, 0.98rem);
    line-height: 1.52;
  }

}

@media (prefers-reduced-motion: reduce) {
  .hero #page-title,
  .hero #page-title.is-segmented-title > span {
    animation: none;
    opacity: 1;
    filter: none;
    transform: none;
  }
}


@media (max-width: 460px) {
  html[data-page="reaction"] .hero {
    width: min(100% - 22px, 1200px);
  }

  html[data-page="coreball"] .hero {
    padding: 36px 16px;
    border-radius: 18px;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  html[data-page="coreball"] .hero {
    margin-top: 16px;
    padding: 26px 18px;
  }
}

/* Shared records, content cards, guides, and FAQ */

.hero {
  font-family: var(--font-sans);
}

.hero #page-title {
  font-family: inherit;
  letter-spacing: -0.035em;
  text-shadow: none;
}

.title-cps,
.title-test {
  color: inherit;
}

.stat-label {
  position: relative;
  z-index: 1;
  display: block;
  color: var(--muted);
  font-family: "SF Pro Rounded", "Avenir Next Rounded", "Comic Sans MS", var(--font-sans);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: none;
}

.popular-tests-section {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto var(--page-card-gap);
  padding: clamp(20px, 3vw, 30px);
  background: #ffffff;
  border-radius: 24px;
}

.popular-tests-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: clamp(16px, 2.2vw, 22px);
}

.popular-test-card {
  min-width: 0;
}

.test-link {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  height: 100%;
  padding: 16px;
  background: #fbfdff;
  border: 0;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.test-link:hover {
  background: #f8fbff;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(35, 55, 72, 0.05);
}

.test-link .test-icon {
  position: relative;
  isolation: isolate;
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
}

.test-link .test-icon::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -7px;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 225, 169, 0.34), transparent 50%),
    radial-gradient(circle at 70% 68%, rgba(179, 211, 203, 0.3), transparent 56%);
  border-radius: 46% 54% 58% 42% / 55% 43% 57% 45%;
  filter: blur(8px);
  opacity: 0.5;
  transform: rotate(-4deg);
}

.test-link .test-icon img {
  display: block;
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 46% 54% 51% 49% / 54% 46% 56% 44%;
  -webkit-mask-image: radial-gradient(
    ellipse 54% 52% at 50% 49%,
    #000 58%,
    rgba(0, 0, 0, 0.94) 66%,
    rgba(0, 0, 0, 0.7) 76%,
    rgba(0, 0, 0, 0.36) 86%,
    rgba(0, 0, 0, 0.12) 94%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 54% 52% at 50% 49%,
    #000 58%,
    rgba(0, 0, 0, 0.94) 66%,
    rgba(0, 0, 0, 0.7) 76%,
    rgba(0, 0, 0, 0.36) 86%,
    rgba(0, 0, 0, 0.12) 94%,
    transparent 100%
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transform: translateZ(0);
}

.test-content h3 {
  margin: 0 0 4px;
  color: #172a3b;
  font-size: 1rem;
  line-height: 1.25;
}

.test-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.test-link:focus-visible {
  outline: 3px solid rgba(107, 101, 220, 0.25);
  outline-offset: 3px;
}

@media (min-width: 900px) {
  .popular-tests-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.records-section {
  width: min(1200px, calc(100% - 32px));
  margin: calc(-1 * var(--records-card-overlap)) auto var(--page-card-gap);
  padding: clamp(18px, 3vw, 28px);
  background: #ffffff;
  border-radius: 22px 20px 24px 19px;
}

.records-section[hidden] {
  display: none !important;
}

.records-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding: 0 2px 17px;
  border-bottom: 1px solid rgba(61, 87, 125, 0.1);
}

.records-title-block {
  min-width: 0;
}

.records-head h2 {
  margin: 0;
  color: #172a3b;
  font-family: var(--font-display);
  font-size: var(--section-card-heading-size);
  line-height: 1.05;
}

.records-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: transparent;
  border: 0;
}

.records-clear,
.records-close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: #5d6edb;
  background: transparent;
  border: none;
  border-radius: 10px;
  box-shadow: none;
  cursor: pointer;
  appearance: none;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.records-clear svg,
.records-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.records-close svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
  transition: transform 180ms ease;
}

.records-clear:hover,
.records-close:hover {
  color: #4656bf;
  background: #ffffff;
  transform: translateY(-1px);
}

.records-close:hover svg,
.records-close:focus-visible svg {
  transform: rotate(8deg) scale(1.06);
}

.records-clear:focus-visible,
.records-close:focus-visible {
  outline: 3px solid rgba(107, 101, 220, 0.25);
  outline-offset: 3px;
}

.records-table-wrap {
  position: relative;
  overflow: hidden;
  padding: 7px;
  background: rgba(255, 255, 255, 0.58);
  border-radius: 18px 16px 20px 15px;
}

.records-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  text-align: center;
  table-layout: fixed;
}

.records-table th:nth-child(2),
.records-table td:nth-child(2),
.records-table th:nth-child(3),
.records-table td:nth-child(3),
.records-table th:nth-child(4),
.records-table td:nth-child(4) {
  width: 17%;
}

.records-table th:nth-child(5),
.records-table td:nth-child(5) {
  width: 27%;
}

.records-table-wrap:has(.records-empty:not([hidden])) .records-table {
  display: none;
}

.records-table th,
.records-table td {
  padding: 12px 14px;
  text-align: center;
  white-space: nowrap;
}

.records-table thead th {
  color: #65706b;
  background: transparent;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
}

.records-table tbody th,
.records-table tbody td {
  color: #172a3b;
  background: #ffffff;
  border: 0;
  font-size: 0.93rem;
  font-weight: 750;
}

.records-table tbody th {
  border-radius: 12px 0 0 12px;
}

.records-table tbody td:last-child {
  border-radius: 0 12px 12px 0;
}

.records-table tbody tr:hover {
  transform: translateY(-1px);
}

.records-table tbody tr {
  transition: transform 180ms ease;
}

.records-table tbody tr:hover th,
.records-table tbody tr:hover td {
  background: #fbfdff;
  box-shadow: none;
}

.records-table tbody td:nth-child(4),
.records-table tbody td:nth-child(5) {
  font-weight: 900;
}

.records-table tbody td:nth-child(5) {
  color: #172a3b;
}

.records-empty {
  margin: 0;
  padding: 24px 16px 26px;
  color: #65706b;
  text-align: center;
  background: #fbfdff;
  border-radius: 14px 12px 16px 11px;
  font-weight: 750;
}

.records-empty[hidden] {
  display: none;
}

.feature-section,
.faq-section {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto var(--page-card-gap);
  padding: clamp(22px, 4vw, 38px);
  background: #ffffff;
  border-radius: 24px;
}

.section-intro {
  max-width: 760px;
  margin: 0 0 clamp(20px, 3vw, 30px);
}

.section-intro h2 {
  margin: 0;
  color: #172a3b;
  font-family: var(--font-display);
  font-size: var(--section-card-heading-size);
  line-height: 1.05;
}

.seo-section .section-intro h2 {
  display: block;
  margin: 0;
  color: #172a3b;
  font-family: var(--font-display);
  font-size: var(--section-card-heading-size);
  line-height: 1.05;
}

.section-intro > p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.4vw, 1.08rem);
  line-height: 1.75;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.feature-card {
  min-width: 0;
  padding: 18px;
  background: #fbfdff;
  border: 0;
  border-radius: 16px;
  transition: transform 180ms ease, background-color 180ms ease;
}

.feature-card:hover {
  background: #f8fbff;
  transform: translateY(-2px);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  color: #6b65dc;
  background: #f1f4ff;
  border-radius: 12px;
}

.feature-card:nth-child(2n) .feature-icon {
  color: #5d9cec;
  background: #eef6ff;
  border-color: rgba(93, 156, 236, 0.16);
}

.feature-card:nth-child(3n) .feature-icon {
  color: #9a73cf;
  background: #f6f1ff;
  border-color: rgba(154, 115, 207, 0.16);
}

.feature-card:nth-child(4n) .feature-icon {
  color: #2f9b86;
  background: #eef9f6;
  border-color: rgba(47, 155, 134, 0.16);
}

.feature-card:nth-child(4) .feature-icon {
  color: #5d6edb;
  background: #eef3ff;
  border-color: rgba(93, 110, 219, 0.16);
}

.feature-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.feature-card h3 {
  margin: 0 0 8px;
  color: #172a3b;
  font-size: 1rem;
  line-height: 1.25;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.66;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  overflow: hidden;
  background: #fbfdff;
  border-radius: 14px;
}

.faq-list details[open] {
  background: #f8fbff;
  border-color: rgba(107, 101, 220, 0.18);
}

.faq-list summary {
  position: relative;
  min-height: 54px;
  padding: 15px 52px 15px 18px;
  color: #172a3b;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.35;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 18px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #6b65dc;
  background: #f1f4ff;
  border-radius: 50%;
  transform: translateY(-50%);
}

.faq-list details[open] summary::after {
  content: "-";
}

.faq-list p {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
  line-height: 1.72;
}

.seo-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto var(--page-card-gap);
  padding: clamp(22px, 4vw, 38px);
  background: #ffffff;
  border-radius:24px;
}

.guide-intro {
  margin-bottom: 8px;
}

.seo-section > article {
  --seo-accent: #7467df;
  --seo-soft: #f4f2ff;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
  padding: 24px 0;
  background: transparent;
  border-bottom: 1px solid rgba(23, 42, 59, 0.08);
  border-radius: 0;
  box-shadow: none;
  transition: border-color 180ms ease, transform 180ms ease;
}

.seo-section > article:nth-child(2) {
  --seo-accent: #5d9cec;
  --seo-soft: #eef6ff;
}

.seo-section > article:nth-child(3) {
  --seo-accent: #9a73cf;
  --seo-soft: #f6f1ff;
}

.seo-section > article:nth-child(4) {
  --seo-accent: #2f9b86;
  --seo-soft: #eef9f6;
}

.seo-section > article:nth-child(5) {
  --seo-accent: #d89a3d;
  --seo-soft: #fff7ea;
}

.seo-section > article::before {
  content: none;
}

.seo-section > article::after {
  content: none;
}

.seo-section > article:hover {
  border-color: color-mix(in srgb, var(--seo-accent) 28%, rgba(23, 42, 59, 0.08));
  transform: translateX(2px);
}

.seo-section h2 {
  display: flex;
  grid-column: 1;
  align-items: center;
  margin: 0 0 10px;
  color: #17231e;
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  line-height: 1.25;
}

.seo-section h2 > span:last-child {
  min-width: 0;
}

.seo-section > article > p,
.seo-section > article > ul {
  grid-column: 1;
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.seo-section > article > ul {
  padding-left: 0;
  list-style: none;
}

.seo-section > article li {
  position: relative;
  padding-left: 18px;
}

.seo-section > article li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.78em;
  width: 5px;
  height: 5px;
  background: var(--seo-accent);
  border-radius: 50%;
  opacity: 0.78;
}

.seo-section > article li + li {
  margin-top: 6px;
}

.score-level-detail {
  display: grid;
  grid-column: 1;
  gap: 16px;
  min-width: 0;
}

.score-level-detail p {
  grid-column: auto;
}

.score-level-table-wrap {
  min-width: 0;
  overflow-x: auto;
  border-radius: 18px;
}

.score-level-matrix {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: #172a3b;
  font-size: 0.92rem;
}

.score-level-matrix th,
.score-level-matrix td {
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

.score-level-matrix thead th {
  color: #59685f;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.score-level-matrix tbody th {
  color: #172a3b;
  font-weight: 900;
  white-space: nowrap;
}

.score-level-matrix tbody tr + tr {
  border-top: 1px solid rgba(116, 103, 223, 0.12);
}

.score-level-matrix td {
  color: #546960;
  line-height: 1.48;
}

@media (max-width: 760px) {
  html {
      scroll-padding-top: 82px;
    }

  #popular-tests,
  #score-records,
  #features,
  #guide,
  #faq,
  #score-levels,
  #about,
  #privacy-policy,
  #disclaimer {
      scroll-margin-top: 82px;
    }

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

  .feature-section,
  .faq-section {
      padding: 20px;
    }

  .records-head {
      align-items: stretch;
      flex-direction: column;
      gap: 14px;
    }

  .records-clear,
  .records-close {
      width: 44px;
    }

  .records-table-wrap {
      overflow-x: auto;
      overflow-y: hidden;
      padding: 7px 7px 10px;
      background: rgba(255, 255, 255, 0.58);
      border: 0;
      border-radius: 18px 16px 20px 15px;
      scrollbar-width: thin;
      -webkit-overflow-scrolling: touch;
    }

  .records-table {
      width: 100%;
      min-width: 620px;
      table-layout: fixed;
      border-spacing: 0 6px;
    }

  .records-table th,
  .records-table td {
      padding: 12px 14px;
      text-align: center;
      white-space: nowrap;
    }

  .seo-section {
      grid-template-columns: 1fr;
    }

  .seo-section {
      gap: 0;
      padding: 20px;
    }

  .seo-section > article {
      grid-template-columns: minmax(0, 1fr);
      gap: 0;
      padding: 20px 0;
    }

  .seo-section h2 {
      grid-column: 1;
      align-items: center;
      font-size: 1.14rem;
    }

  .seo-section .section-intro h2 {
      font-size: var(--section-card-heading-size);
    }

}

@media (max-width: 560px) {
  html {
      scroll-padding-top: 76px;
    }

  #popular-tests,
  #score-records,
  #features,
  #guide,
  #faq,
  #score-levels,
  #about,
  #privacy-policy,
  #disclaimer {
      scroll-margin-top: 76px;
    }

  .records-head {
      position: relative;
      padding-right: 108px;
    }

  .records-actions {
      position: absolute;
      top: 0;
      right: 0;
    }
}

@media (max-width: 460px) {
  :root {
    --records-card-overlap: 30px;
  }

  .records-section,
  .feature-section,
  .seo-section,
  .faq-section {
      width: min(100% - 22px, 1200px);
    }

  .records-section {
      margin-top: calc(-1 * var(--records-card-overlap));
      padding: 16px;
    }

  .feature-section,
  .seo-section,
  .faq-section {
      padding-right: 16px;
      padding-left: 16px;
    }

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

  .feature-card {
      padding: 16px;
    }

  .faq-list summary {
      padding-left: 16px;
    }

  .seo-section > article {
      grid-template-columns: minmax(0, 1fr);
      gap: 12px;
      padding: 18px 0;
    }

  .seo-section h2,
  .seo-section > article > p,
  .seo-section > article > ul,
  .score-level-detail {
      grid-column: 1 / 2;
    }

}

html[data-page="spacebar"].is-app-mobile-viewport .navbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: auto;
  padding: 10px 0;
  align-items: center;
  gap: 8px;
}

html[data-page="spacebar"].is-app-mobile-viewport .nav-links {
  grid-column: 2 / 3;
  min-width: 0;
  width: 100%;
  margin-left: 0;
  overflow-x: auto;
  justify-content: flex-start;
  flex-wrap: nowrap;
  white-space: nowrap;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}

html[data-page="spacebar"].is-app-mobile-viewport .nav-links a {
  flex: 0 0 auto;
}

html[data-page="spacebar"].is-app-mobile-viewport .language-switcher {
  grid-column: 3 / 4;
  align-self: center;
  justify-self: end;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
      scroll-behavior: auto !important;
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important;
    }
}

.record-rounds-toggle:focus-visible {
  outline: 3px solid rgba(107, 101, 220, 0.25);
  outline-offset: 3px;
}

.record-rounds-toggle {
  display: inline;
  padding: 0;
  color: #2563eb;
  font: inherit;
  font-weight: 900;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: color 160ms ease;
}

.record-rounds-toggle:hover,
.record-rounds-toggle.is-open {
  color: #1d4ed8;
}

.record-rounds-row[hidden] {
  display: none;
}

.records-table tbody tr.record-rounds-row {
  background: #f5f9ff;
  border-top: 0;
}

.record-rounds-row td {
  padding-top: 0;
  white-space: normal;
}

.record-rounds-detail {
  padding: 14px;
  background: linear-gradient(135deg, #f7fbff, #eef5ff);
  border-radius: 16px;
}

.record-rounds-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 9px;
}

.record-round-pill {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  color: #546960;
  background: #ffffff;
  border: 1px solid rgba(23, 42, 59, 0.06);
  border-radius: 13px;
}

.record-round-pill span {
  color: #7b8984;
  font-size: 0.76rem;
  font-weight: 900;
}

.record-round-pill strong {
  color: #172a3b;
  font-size: 1rem;
  line-height: 1.2;
}

.record-round-pill[data-fastest="true"] strong {
  color: #16875f;
}

.record-round-pill[data-slowest="true"] strong {
  color: #b96f25;
}

.seo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.info-card {
  --seo-accent: #7467df;
  --seo-soft: #f4f2ff;
  position: relative;
  padding: 24px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(23, 42, 59, 0.08);
  border-radius: 0;
  transition: transform 180ms ease, border-color 180ms ease;
}

.info-card:hover {
  transform: translateX(2px);
}

.info-card:nth-child(2) {
  --seo-accent: #5d9cec;
  --seo-soft: #eef6ff;
}

.info-card:nth-child(3) {
  --seo-accent: #9a73cf;
  --seo-soft: #f6f1ff;
}

.info-card:nth-child(4) {
  --seo-accent: #2f9b86;
  --seo-soft: #eef9f6;
}

.info-card h3 {
  margin: 0 0 10px;
  color: #17231e;
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  line-height: 1.25;
}

.info-card p,
.info-card ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.info-card li {
  color: var(--muted);
}

.info-card ul {
  padding-left: 0;
  list-style: none;
}

.info-card li {
  position: relative;
  padding-left: 18px;
}

.info-card li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.78em;
  width: 5px;
  height: 5px;
  background: var(--seo-accent);
  border-radius: 50%;
  opacity: 0.78;
}

.info-card li + li {
  margin-top: 6px;
}

.faq-difficulty-content {
  padding: 0 18px 20px;
}

.faq-list .faq-difficulty-content p {
  padding: 0;
}

.faq-difficulty-content section {
  padding: 16px 0;
  border-top: 1px solid rgba(23, 42, 59, 0.08);
}

.faq-difficulty-content h3 {
  margin: 0 0 6px;
  color: #172a3b;
  font-size: 0.98rem;
  line-height: 1.35;
}

.faq-difficulty-intro {
  padding-bottom: 16px !important;
}

.faq-difficulty-note {
  padding-top: 16px !important;
  border-top: 1px solid rgba(23, 42, 59, 0.08);
}

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

/* Shared footer */

.site-footer {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto var(--footer-margin-bottom, 34px);
  color: var(--muted);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
  min-height: 86px;
  padding: var(--footer-inner-padding, 22px clamp(20px, 3vw, 40px));
  background: #ffffff;
  border-radius: 24px;
}

.footer-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.footer-summary p {
  margin: 0;
  color: #65706b;
  font-size: 0.94rem;
  line-height: 1.55;
}

.footer-brand {
  font-size: clamp(1.05rem, 1.8vw, 1.32rem);
}

.footer-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 10px;
  color: #4f5b56;
  font-size: 0.94rem;
  font-weight: 750;
}

.footer-nav-separator {
  color: #c4cbc7;
  font-weight: 650;
  line-height: 1;
}

.footer-nav a {
  position: relative;
  padding: 4px 0;
  transition: color 180ms ease;
}

.footer-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: #6b65dc;
  border-radius: 999px;
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity 180ms ease, transform 180ms ease;
}

.footer-nav a:hover {
  color: #172a3b;
}

.footer-nav a:hover::after {
  opacity: 0.72;
  transform: scaleX(1);
}

.footer-nav a:focus-visible {
  outline: 3px solid rgba(107, 101, 220, 0.25);
  outline-offset: 3px;
}

.footer-copyright {
  margin: 0;
  color: #75817b;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .footer-inner {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: var(--footer-mobile-inner-padding, 18px clamp(16px, 4vw, 20px));
    align-items: start;
    gap: var(--footer-mobile-gap, 14px);
  }

  .footer-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .footer-nav {
    min-width: 0;
    width: 100%;
    margin-left: 0;
    overflow: visible;
    justify-content: flex-start;
    flex-wrap: wrap;
    white-space: normal;
    padding: 2px 0;
    align-content: center;
  }

  .footer-copyright {
    white-space: normal;
  }
}

@media (max-width: 460px) {
  .site-footer {
    width: min(100% - 22px, 1200px);
  }

  .footer-nav {
    gap: 5px 8px;
    font-size: 0.86rem;
  }

  .footer-nav a {
    flex: 0 0 auto;
    padding: var(--footer-link-mobile-padding, 7px 9px);
  }
}
