:root {
  --bg: #0e0e11;
  --fg: #e8e8ea;
  --muted: #b6b6c2;
  --accent: #c9b37e;
  --line: #2a2a35;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

header, section, footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

header h1 {
  font-size: 2.6rem;
  margin-bottom: 0.5rem;
}

header h2 {
  font-weight: normal;
  font-size: 1.2rem;
  color: var(--muted);
}

section {
  border-top: 1px solid var(--line);
}

h3 {
  font-size: 1.5rem;
  margin-top: 0;
}

blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin-left: 0;
  color: var(--muted);
}

.cta {
  margin-top: 2rem;
  font-style: italic;
}

footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.kwBlock{
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
}

.kwTitle{
  color: var(--fg);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.kwCloud{
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: baseline;
}

.kwCloud a{
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255,255,255,0.18);
  padding-bottom: 1px;
}

.kwCloud a:hover{
  filter: brightness(1.15);
  border-bottom-color: rgba(255,255,255,0.35);
}


  .topnav{
    max-width: 900px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 0;
    display:flex;
    flex-wrap:wrap;
    gap:.75rem 1rem;
    align-items:baseline;
    justify-content:space-between;
  }
  .topnav .links{
    display:flex;
    flex-wrap:wrap;
    gap:.6rem .9rem;
    align-items:baseline;
  }
  .topnav .links a{
    color: var(--accent);
    border-bottom: 1px dashed rgba(255,255,255,0.18);
    padding-bottom: 1px;
  }
  .topnav .links a:hover{
    text-decoration:none;
    border-bottom-color: rgba(255,255,255,0.35);
    filter: brightness(1.12);
  }

/* =========================================================
   Mobile-first polish (Nostradamus Unveiled)
   Paste at END of styles.css
   ========================================================= */

/* Prevent accidental horizontal scroll on mobile */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Make typography breathe on small screens */
@media (max-width: 720px) {

  header {
    padding: 18px 16px;
  }

  header h1 {
    font-size: 1.55rem;
    line-height: 1.15;
    margin-bottom: 8px;
  }

  header h2 {
    font-size: 1rem;
    line-height: 1.35;
    margin-top: 0;
  }

  /* Generic section padding */
  .block,
  .status,
  .toolbar,
  footer {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Corpus toolbar: stack cleanly */
  .toolbar {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .toolbar .row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* Mode row: keep button reachable */
  #btnView {
    width: 100%;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  /* Inputs/selects feel better full width */
  input, select, button {
    width: 100%;
    box-sizing: border-box;
  }

  /* Card layout: single column always */
  .cards {
    grid-template-columns: 1fr !important;
  }

  /* Within card, stack French/English instead of side-by-side */
  .textgrid {
    grid-template-columns: 1fr !important;
  }

  /* Reduce card padding slightly */
  .card {
    padding: 12px 12px 10px !important;
  }

  /* Meta row: avoid cramping */
  .card .meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* Ordered lists in cards: prevent overflow */
  .lines {
    padding-left: 1.15rem;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  /* Notes: keep readable */
  .notes {
    font-size: 0.95rem;
    line-height: 1.35;
  }

  /* Keyword cloud block: avoid cramped rows */
  .kwCloud {
    gap: 8px 10px;
  }

  /* Links: easier taps */
  .kwCloud a {
    padding: 3px 2px;
  }
}

/* Optional: slightly tighter mid-range tablets */
@media (min-width: 721px) and (max-width: 980px) {
  .toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .cards {
    grid-template-columns: 1fr;
  }
}
