:root {
  color-scheme: light;
  --bg: #f5efe3;
  --bg-accent: #ead9bb;
  --panel: rgba(255, 250, 240, 0.9);
  --ink: #19120d;
  --muted: #6c5a4d;
  --line: rgba(25, 18, 13, 0.12);
  --accent: #a23128;
  --accent-soft: rgba(162, 49, 40, 0.14);
  --shadow: 0 18px 50px rgba(58, 33, 13, 0.12);
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --font-body: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 30%),
    linear-gradient(180deg, var(--bg-accent), var(--bg));
  color: var(--ink);
  font-family: var(--font-body);
}

a {
  color: inherit;
}

code {
  font-size: 0.95em;
}

.page-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 80px;
}

.hero {
  padding: 24px 28px 28px;
  text-align: center;
}

.hero__home {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08em;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
  text-decoration: none;
}

.hero__line {
  display: block;
}

.hero__bible-word {
  display: block;
  width: min(100%, 7.2em);
  height: auto;
  margin-top: 0.06em;
}

.hero__kicker {
  color: var(--muted);
  margin: 12px 0 24px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
}

.tweet-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
}

.select-wrap {
  position: relative;
  display: block;
  min-width: 0;
}

.select-wrap__value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  color: var(--ink);
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tweet-form input,
.tweet-form select,
.tweet-form button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 16px 20px;
  font: inherit;
}

.tweet-form input {
  background: rgba(255, 252, 246, 0.85);
}

.tweet-form select {
  background: rgba(255, 252, 246, 0.85);
  width: calc(var(--source-select-chars, 8) * 1ch + 4rem);
  min-width: 0;
  cursor: pointer;
  text-align: center;
  color: transparent;
}

.tweet-form select option {
  color: var(--ink);
}

.tweet-form button {
  background: var(--ink);
  color: white;
  cursor: pointer;
}

.source-selected {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
  min-height: 1.35em;
}

.app-shell {
  display: grid;
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px;
  backdrop-filter: blur(6px);
}

.panel h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin: 0 0 12px;
  line-height: 1;
}

.panel p {
  font-size: 1.08rem;
  line-height: 1.7;
  margin: 0 0 12px;
}

.loading {
  text-align: center;
}

.tweet-embed {
  display: flex;
  justify-content: center;
}

.tweet-text {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.9;
  white-space: break-spaces;
  overflow-wrap: anywhere;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--muted);
}

.source-tag {
  color: var(--muted);
  font-size: 0.55em;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.word {
  transition: background-color 120ms ease, color 120ms ease;
}

.word--present {
  border-bottom: 1px dotted var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.word--present:hover,
.word--present:focus {
  background: rgba(25, 18, 13, 0.08);
  outline: none;
}

.word--normalized {
  background: rgba(25, 18, 13, 0.09);
  border-radius: 0.22em;
  padding: 0.02em 0.14em;
}

.word--missing {
  color: var(--accent);
}

.tooltip {
  position: absolute;
  z-index: 10;
  width: min(320px, calc(100vw - 32px));
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.98);
  box-shadow: var(--shadow);
}

.tooltip__label {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(25, 18, 13, 0.07);
  color: var(--muted);
  font-size: 0.88rem;
}

.tooltip__verse {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  text-decoration: none;
}

.tooltip__verse:hover {
  background: rgba(25, 18, 13, 0.06);
}

.tooltip__verse strong {
  font-size: 0.94rem;
}

.tooltip__verse span {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.tooltip__match {
  padding: 0 0.14em;
  border-radius: 0.2em;
  background: rgba(162, 49, 40, 0.18);
  color: inherit;
}

.verse-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.verse-card {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.verse-card a {
  font-weight: 700;
  text-decoration: none;
}

.muted {
  color: var(--muted);
}

.panel--error {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.96), rgba(234, 217, 187, 0.82)),
    var(--panel);
}

.panel--error::after {
  content: "";
  position: absolute;
  inset: auto -60px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(162, 49, 40, 0.16), transparent 68%);
  pointer-events: none;
}

.error-code {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.error-verse {
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 252, 246, 0.78);
}

.error-verse__eyebrow {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.error-verse__link {
  display: inline-block;
  margin-bottom: 8px;
  font-weight: 700;
  text-decoration: none;
}

.error-verse__text {
  margin: 0;
  color: var(--ink);
}

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

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 20px, 1120px);
    padding-top: 20px;
  }

  .hero,
  .panel {
    padding: 20px;
  }

  .tweet-form {
    grid-template-columns: 1fr;
  }

  .tweet-form button {
    width: 100%;
  }

  .hero__bible-word {
    width: min(100%, 5.6em);
  }
}
