html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.dictionary-hero {
  background: radial-gradient(ellipse at top, #e9f2ff 0, #f8f9fa 68%);
  border-radius: 1.5rem;
  padding-inline: 1rem;
}

.dictionary-hero h1,
.word-detail h1 {
  color: #14233b;
  letter-spacing: -0.04em;
}

.dictionary-hero .lead {
  max-width: 42rem;
}

.eyebrow {
  color: #527091;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.search-form {
  display: flex;
  gap: .65rem;
  max-width: 44rem;
}

.search-form .form-control {
  min-width: 0;
}

.section-heading {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-heading h2,
.page-heading h1 {
  color: #14233b;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 700;
  margin: 0;
}

.section-heading .eyebrow {
  margin-bottom: .25rem;
}

.alphabet-nav {
  display: flex;
  gap: .45rem;
  overflow-x: auto;
  padding: .3rem .1rem .8rem;
  scrollbar-width: thin;
}

.alphabet-letter {
  align-items: center;
  background: #fff;
  border: 1px solid #dce5f0;
  border-radius: .65rem;
  color: #175bcc;
  display: inline-flex;
  flex: 0 0 2.45rem;
  font-weight: 700;
  height: 2.45rem;
  justify-content: center;
  text-decoration: none;
  transition: background-color .15s ease, transform .15s ease;
}

.alphabet-letter:hover,
.alphabet-letter:focus-visible {
  background: #eaf2ff;
  transform: translateY(-2px);
}

.alphabet-letter.disabled {
  background: #f1f3f6;
  color: #9ba8b7;
}

.stats-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card,
.word-card,
.empty-note,
.word-detail {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 .3rem 1rem rgba(22, 47, 78, .04);
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 1.1rem 1.25rem;
}

.stat-card strong {
  color: #175bcc;
  font-size: 1.8rem;
  line-height: 1.1;
}

.stat-card span,
.word-card p,
.word-card-meta {
  color: #64748b;
}

.word-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.word-card {
  color: inherit;
  min-width: 0;
  padding: 1.15rem;
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.word-card:hover,
.word-card:focus-visible {
  border-color: #9bbcf4;
  box-shadow: 0 .6rem 1.3rem rgba(22, 47, 78, .09);
  color: inherit;
  transform: translateY(-2px);
}

.word-card h2,
.word-card h3 {
  color: #14233b;
  font-size: 1.2rem;
  font-weight: 700;
  margin: .5rem 0;
}

.word-card p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  margin: 0 0 .7rem;
  overflow: hidden;
}

.word-card-category,
.word-card-meta {
  font-size: .8rem;
}

.word-card-category {
  color: #175bcc;
  font-weight: 600;
}

.empty-note {
  color: #64748b;
  padding: 1.2rem;
}

.back-link {
  color: #175bcc;
  font-weight: 600;
  text-decoration: none;
}

.word-detail {
  margin: 0 auto;
  max-width: 54rem;
  padding: clamp(1.25rem, 5vw, 3rem);
}

.word-detail-header {
  border-bottom: 1px solid #e5eaf1;
  margin: 1.5rem 0;
  padding-bottom: 1.25rem;
}

.word-detail h1 {
  font-size: clamp(2.4rem, 8vw, 4rem);
  font-weight: 800;
  margin: .25rem 0;
}

.word-slug {
  color: #8290a2;
  font-size: .9rem;
}

.word-detail h2 {
  color: #18365e;
  font-size: 1.05rem;
  font-weight: 700;
}

.word-detail section {
  margin: 1.4rem 0;
}

.word-detail section p,
.word-detail blockquote {
  color: #34465d;
  font-size: 1.08rem;
  line-height: 1.75;
  margin-bottom: 0;
}

.example-panel,
.tip-panel {
  background: #f3f7fd;
  border-radius: .85rem;
  padding: 1.1rem 1.25rem;
}

.tip-panel {
  background: #effaf6;
}

@media (max-width: 767.98px) {
  .stats-grid,
  .word-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .navbar .container {
    align-items: flex-start;
    flex-direction: column;
    gap: .7rem;
  }

  .navbar .container > .d-flex {
    flex-wrap: wrap;
  }
}

@media (max-width: 479.98px) {
  .stats-grid,
  .word-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .search-form {
    flex-direction: column;
  }

  .search-form .btn {
    width: 100%;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: .4rem;
  }
}
