/* KeyboardTest.org - global.css
   Shared across homepage and all tool/content pages. */

:root {
  --site-orange: #f5a103;
  --site-orange-dark: #db7d00;
  --site-ink: #172033;
  --site-muted: #5d6677;
  --site-bg: #f6f8fb;
  --site-card: #ffffff;
  --site-border: #e2e7ef;
  --site-success: #16784a;
  --site-radius: 18px;
  --site-shadow: 0 16px 40px rgba(28, 39, 55, .08);
}

/* Layout safety reset: prevents padding/borders from making grid items wider than their cells. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--site-bg);
  color: var(--site-ink);
  font-family: Arial, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body, button, input {
  -webkit-font-smoothing: antialiased;
}

a { color: #9a5600; }
a:hover { color: #6f3e00; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 1000;
  padding: 10px 14px;
  background: #111;
  color: #fff;
  border-radius: 8px;
  font-size: 16px;
}
.skip-link:focus { top: 12px; }

.site-header {
  background: linear-gradient(90deg, #f8b200, #ff8c00);
  border-bottom: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 2px 10px rgba(25, 30, 40, .12);
}
.header-inner {
  width: min(1240px, calc(100% - 32px));
  min-height: 58px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  color: #131313;
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
}
.header-link {
  color: #1c1c1c;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 10px;
}
.header-link:hover { background: rgba(255,255,255,.35); color: #000; }

.hero {
  width: min(980px, calc(100% - 36px));
  margin: 0 auto;
  padding: 46px 0 26px;
  text-align: center;
  font-size: 16px;
  line-height: 1.65;
}
.eyebrow {
  margin: 0 0 8px;
  color: #a65e00;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  color: #121a2a;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -.03em;
}
.hero-copy {
  max-width: 780px;
  margin: 16px auto 0;
  color: var(--site-muted);
  font-size: 18px;
}
.hero-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.hero-badges span {
  padding: 7px 11px;
  border: 1px solid #ead7ba;
  background: #fff8eb;
  border-radius: 999px;
  color: #774500;
  font-size: 13px;
  font-weight: 700;
}


.ad-slot {
  min-height: 110px;
  width: min(1000px, calc(100% - 32px));
  margin: 22px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.content-card {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto 44px;
  padding: 32px;
  background: #fff;
  border: 1px solid var(--site-border);
  border-radius: var(--site-radius);
  box-shadow: 0 10px 30px rgba(28,39,55,.05);
  color: #263044;
  font-size: 17px;
  line-height: 1.72;
}
.content-card section + section {
  margin-top: 40px;
  padding-top: 4px;
}
.content-card h2 {
  margin: 0 0 12px;
  color: #152033;
  font-size: 29px;
  line-height: 1.25;
  letter-spacing: -.015em;
  text-align: left;
}
.content-card h3 {
  margin: 20px 0 6px;
  color: #253149;
  font-size: 20px;
  line-height: 1.35;
  text-align: left;
}
.content-card p { margin: 0 0 14px; padding: 0; text-align: left; }
.content-card ul, .content-card ol { margin: 10px 0 0 22px; padding: 0; }
.content-card li { margin: 7px 0; padding: 0; text-align: left; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.feature-card {
  padding: 17px;
  border: 1px solid var(--site-border);
  border-radius: 14px;
  background: #fafbfd;
}
.feature-card h3 { margin-top: 0; }
.feature-card p:last-child { margin-bottom: 0; }

.faq-section details {
  margin: 10px 0;
  border: 1px solid var(--site-border);
  border-radius: 12px;
  background: #fbfcfe;
}
.faq-section summary {
  cursor: pointer;
  padding: 14px 16px;
  color: #1e293b;
  font-weight: 800;
}
.faq-section details p { padding: 0 16px 14px; margin: 0; }

.related-tool {
  padding: 22px;
  border-radius: 14px;
  background: #fff7e8;
  border: 1px solid #f0d6a3;
}
.text-button {
  display: inline-block;
  margin-top: 4px;
  padding: 10px 15px;
  border-radius: 9px;
  background: #202938;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}
.text-button:hover { color: #fff; background: #111827; }

.site-footer {
  padding: 30px 18px;
  border-top: 1px solid #e1e5eb;
  background: #fff;
  text-align: center;
  color: #687284;
  font-size: 14px;
  line-height: 1.6;
}
.site-footer nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 9px;
}
.site-footer a { font-weight: 700; text-decoration: none; }


/* Shared mobile rules */
@media (max-width: 760px) {
  .header-inner { width: min(100% - 22px, 1240px); min-height: 52px; }
  .brand { font-size: 20px; }
  .header-link { display: none; }
  .hero { width: min(100% - 28px, 980px); padding: 32px 0 20px; }
  .hero-copy { font-size: 16px; }
  .content-card { width: calc(100% - 20px); padding: 22px 18px; font-size: 16px; }
  .content-card h2 { font-size: 25px; }
  .feature-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Shared responsive header navigation
   ========================================================= */
.site-header {
  position: relative;
  z-index: 100;
}

.header-inner {
  position: relative;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;
}

.site-nav .header-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 10px;
  color: #1c1c1c;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease;
}

.site-nav .header-link:hover,
.site-nav .header-link:focus-visible {
  background: rgba(255,255,255,.42);
  color: #000;
  outline: none;
}

.mobile-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.34);
  cursor: pointer;
}

.menu-bar {
  display: block;
  width: 22px;
  height: 2px;
  margin: 4px auto;
  border-radius: 2px;
  background: #171717;
  transition: transform .2s ease, opacity .2s ease;
}

.mobile-menu-button.is-open .menu-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mobile-menu-button.is-open .menu-bar:nth-child(2) { opacity: 0; }
.mobile-menu-button.is-open .menu-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Shared Back to Top button */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  background: linear-gradient(135deg, #f8b200, #ff8c00);
  color: #171717;
  box-shadow: 0 10px 28px rgba(20,28,40,.20);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease, box-shadow .2s ease;
}

.back-to-top:hover { box-shadow: 0 12px 32px rgba(20,28,40,.28); }
.back-to-top:focus-visible { outline: 3px solid rgba(23,32,51,.35); outline-offset: 3px; }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

@media (max-width: 760px) {
  .header-inner {
    min-height: 58px;
  }

  /* Override the older rule that hid .header-link directly. */
  .header-inner > .header-link { display: none; }

  .mobile-menu-button {
    display: block;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    display: grid;
    gap: 5px;
    padding: 8px;
    border: 1px solid #e2e7ef;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(28,39,55,.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .site-nav .header-link {
    display: flex;
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;
    border-radius: 9px;
    color: #202938;
  }

  .site-nav .header-link:hover,
  .site-nav .header-link:focus-visible {
    background: #fff5df;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav,
  .menu-bar,
  .back-to-top { transition: none; }
}
