:root {
  --blue-dark:   #2e5f78;
  --blue-mid:    #4a7a96;
  --blue-light:  #7aafc8;
  --blue-pale:   #d6eaf4;
  --salmon:      #f2a58e;
  --salmon-pale: #fce8e0;
  --white:       #ffffff;
  --off-white:   #fafaf8;
  --text-dark:   #1e3a4a;
  --text-mid:    #4a6272;
  --text-light:  #8aa8bb;
  --border:      #d0e4ef;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  background: var(--off-white);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── HEADER ── */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1.4rem 2rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 18px rgba(46, 95, 120, 0.07);
}

/* ── LOGO ── */
.logo-wrap {
  width: 100%;
  max-width: 560px; /* matches search bar max-width */
  display: flex;
  justify-content: center;
}

.logo-wrap img {
  width: 50%;      /* half the width of the container = ~half search bar width */
  max-width: 280px;
  height: auto;
  display: block;
}

/* ── DIRECTION TOGGLE ── */
.direction-toggle {
  display: flex;
  align-items: center;
  background: var(--blue-pale);
  border-radius: 999px;
  padding: 3px;
}

.dir-btn {
  font-family: 'Lato', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.45rem 1.2rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
  color: var(--blue-mid);
  background: transparent;
  white-space: nowrap;
}

.dir-btn.active {
  background: var(--blue-mid);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(74, 122, 150, 0.3);
}

.dir-sep {
  font-size: 0.75rem;
  color: var(--blue-light);
  padding: 0 0.4rem;
  user-select: none;
}

/* ── SEARCH BAR ── */
.search-wrap {
  width: 100%;
  max-width: 560px;
  position: relative;
}

.search-wrap input {
  width: 100%;
  padding: 0.75rem 2.8rem 0.75rem 1.2rem;
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  font-weight: 300;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--off-white);
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrap input:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(74, 122, 150, 0.12);
  background: var(--white);
}

.search-wrap input::placeholder {
  color: var(--text-light);
}

.search-icon {
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--blue-light);
  pointer-events: none;
  font-size: 1.1rem;
}

.clear-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  display: none;
  padding: 0.1rem 0.2rem;
}

.clear-btn:hover {
  color: var(--blue-mid);
}

/* ── MAIN ── */
main {
  flex: 1;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ── STATUS LINE ── */
.status-line {
  font-size: 0.78rem;
  color: var(--text-light);
  letter-spacing: 0.04em;
  margin-bottom: 1.4rem;
  min-height: 1.2em;
  text-align: center;
  font-style: italic;
}

/* ── HERO ── */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-mid);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 300;
  color: var(--blue-mid);
  margin-bottom: 2rem;
}

.hero-langs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
}

.hero-lang {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.hero-lang-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--blue-dark);
}

.hero-lang-count {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}

.hero-sep {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ── RESULTS ── */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.entry-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.4rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  transition: box-shadow 0.2s, border-color 0.2s;
  animation: fadeUp 0.15s ease both;
}

.entry-card:hover {
  box-shadow: 0 4px 18px rgba(46, 95, 120, 0.1);
  border-color: var(--blue-light);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.entry-source {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--blue-dark);
  line-height: 1.3;
}

.entry-source mark {
  background: transparent;
  color: var(--salmon);
}

.entry-arrow {
  color: var(--blue-light);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.entry-target {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.55;
}

.variant-sep {
  display: inline-block;
  margin: 0 0.35rem;
  color: var(--salmon);
}

.entry-variants-badge {
  display: inline-block;
  font-size: 0.6rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--salmon-pale);
  color: var(--salmon);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  margin-left: 0.5rem;
  vertical-align: middle;
  font-family: 'Lato', sans-serif;
  font-weight: 400;
}

/* ── NO RESULTS ── */
.no-results {
  text-align: center;
  padding: 3rem 0;
}

.no-results-glyph {
  font-size: 2rem;
  color: var(--border);
  margin-bottom: 0.8rem;
}

.no-results p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-light);
}

/* ── LOADING ── */
.loading {
  text-align: center;
  padding: 4rem 0;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--text-light);
}

.dot {
  display: inline-block;
  animation: blink 1.2s ease infinite;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; }
  40%           { opacity: 1; }
}

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 1.1rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  background: var(--white);
}

footer a {
  color: var(--blue-light);
  text-decoration: none;
}

footer a:hover {
  color: var(--blue-mid);
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  header {
    padding: 1rem 1rem 0.9rem;
    gap: 0.9rem;
  }

  /* On small screens logo scales to 70% of the search bar width */
  .logo-wrap img {
    width: 70%;
  }

  main {
    padding: 1.5rem 1rem 3rem;
  }

  .entry-card {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .entry-arrow {
    display: none;
  }

  .entry-target {
    border-left: 2px solid var(--blue-pale);
    padding-left: 0.7rem;
  }
}

@media (max-width: 380px) {
  .logo-wrap img {
    width: 85%;
  }

  .dir-btn {
    font-size: 0.65rem;
    padding: 0.4rem 0.8rem;
  }
}
