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

body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  padding: 3rem 1.5rem 2rem;
  text-align: center;
  background: radial-gradient(circle at top, rgba(94, 234, 212, 0.2), transparent),
    rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.site-header h1 {
  font-size: 2.5rem;
  margin: 0 0 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tagline {
  margin: 0;
  color: #94a3b8;
}

.site-nav {
  margin-top: 1.75rem;
  display: inline-flex;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.65);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 10px 25px rgba(3, 7, 18, 0.35);
}

.nav-link {
  text-decoration: none;
  color: #cbd5f5;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  color: #f8fafc;
  background: rgba(56, 189, 248, 0.15);
}

.nav-link-active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(217, 70, 239, 0.15));
  color: #f8fafc;
}

.content {
  flex: 1;
  padding: 2.5rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 1.5rem;
}

.tab-nav {
  width: 100%;
  max-width: 900px;
  display: inline-flex;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.55);
  padding: 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 15px 45px rgba(3, 7, 18, 0.4);
}

.tab-button {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.tab-button[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(217, 70, 239, 0.25));
  color: #f8fafc;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.45);
}

.tab-panel {
  width: 100%;
  max-width: 900px;
  background: rgba(30, 41, 59, 0.65);
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 2rem;
  box-shadow: 0 20px 48px rgba(8, 47, 73, 0.35);
  backdrop-filter: blur(8px);
}

.home-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: left;
}

.home-hero h2 {
  margin: 0 0 0.75rem;
  font-size: 2rem;
  letter-spacing: 0.02em;
}

.home-hero p {
  margin: 0;
  color: #cbd5f5;
  font-size: 1rem;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.home-card {
  padding: 1.25rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.home-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: #f8fafc;
}

.home-card p {
  margin: 0;
  color: #cbd5f5;
  font-size: 0.95rem;
}

.home-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.home-cta p {
  margin: 0;
  color: #e2e8f0;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

.cta-button {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f172a;
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.35);
  text-decoration: none;
}

.reader-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.passage-controls {
  width: 100%;
  max-width: 700px;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.picker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #cbd5f5;
}

.picker-label {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.9);
}

[data-passage-select] {
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  font-size: 0.95rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #38bdf8 50%),
    linear-gradient(135deg, #38bdf8 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  min-width: 220px;
}

[data-passage-select]:focus {
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 2px;
}

.author-panel[hidden] {
  display: none;
}

.author-panel {
  min-width: 240px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
  padding: 0.6rem 0.75rem;
}

.author-panel summary {
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #cbd5f5;
  list-style: none;
}

.author-panel summary::-webkit-details-marker {
  display: none;
}

.author-panel-body {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 0.75rem;
}

.author-search {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.author-search-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.author-search input {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.7);
  color: #f8fafc;
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
}

.author-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 180px;
  overflow-y: auto;
}

.author-panel button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #94a3b8;
  padding: 0.35rem 0.25rem;
  border-radius: 6px;
  cursor: pointer;
}

.author-panel button:hover,
.author-panel button.active {
  background: rgba(56, 189, 248, 0.18);
  color: #f8fafc;
}

.author-passages {
  border-left: 1px dashed rgba(148, 163, 184, 0.3);
  padding-left: 0.75rem;
}

.author-passages ul {
  max-height: 180px;
  overflow-y: auto;
}

.author-passages li {
  margin-bottom: 0.35rem;
}

.author-passages button {
  color: #e2e8f0;
}

.author-hint {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.passage {
  max-width: 700px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 18px;
  padding: 2.5rem;
  line-height: 1.7;
  box-shadow: 0 20px 45px rgba(8, 47, 73, 0.35);
  backdrop-filter: blur(8px);
}

.passage h2 {
  margin-top: 0;
  color: #f8fafc;
  font-size: 1.6rem;
  letter-spacing: 0.03em;
}

.passage-body {
  margin: 1.25rem 0 0;
  white-space: pre-line;
}

.passage-status {
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(30, 41, 59, 0.65);
  font-size: 0.92rem;
  color: #cbd5f5;
}

.passage-status[data-variant="warning"] {
  border-color: rgba(251, 191, 36, 0.35);
  color: #facc15;
}

.passage-status[data-variant="error"] {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.passage-status[data-variant="info"] {
  border-color: rgba(14, 165, 233, 0.35);
  color: #38bdf8;
}

.annotated {
  position: relative;
  color: #38bdf8;
  cursor: pointer;
  transition: color 0.2s ease, text-shadow 0.2s ease;
  text-decoration: underline dotted;
  text-decoration-color: rgba(56, 189, 248, 0.6);
  text-decoration-thickness: 2px;
}

.annotated:focus {
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 3px;
}

.annotated:hover,
.annotated[data-active="true"] {
  color: #f9a8d4;
  text-shadow: 0 0 15px rgba(248, 113, 113, 0.35);
}

.tooltip {
  position: fixed;
  pointer-events: none;
  min-width: 220px;
  max-width: 320px;
  padding: 1rem 1.2rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.5);
  transform: translate(-50%, -110%);
  transition: opacity 0.1s ease;
  opacity: 0;
  z-index: 20;
}

.tooltip-title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
}

.tooltip-body {
  margin: 0;
  font-size: 0.95rem;
  color: #cbd5f5;
  white-space: pre-line;
}

.tooltip[data-visible="true"] {
  opacity: 1;
}

.mobile-panel {
  position: fixed;
  inset: auto 0 0;
  background: rgba(15, 23, 42, 0.95);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 1.5rem 1.25rem 2.25rem;
  box-shadow: 0 -15px 35px rgba(15, 23, 42, 0.45);
  transform: translateY(100%);
  transition: transform 0.25s ease;
  z-index: 30;
}

.mobile-panel[data-visible="true"] {
  transform: translateY(0);
}

.panel-content {
  max-width: 640px;
  margin: 0 auto;
}

.panel-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  color: #f8fafc;
}

.panel-body {
  margin: 0;
  color: #cbd5f5;
  font-size: 1rem;
  line-height: 1.5;
  white-space: pre-line;
}

.tooltip .annotation-entry + .annotation-entry,
.mobile-panel .annotation-entry + .annotation-entry {
  margin-top: 1.1rem;
}

.tooltip .annotation-label {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
}

.tooltip .annotation-gloss {
  margin: 0;
  font-size: 0.95rem;
  color: #cbd5f5;
  white-space: pre-line;
}

.mobile-panel .annotation-label {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  color: #f8fafc;
}

.mobile-panel .annotation-gloss {
  margin: 0;
  font-size: 1rem;
  color: #cbd5f5;
  line-height: 1.5;
  white-space: pre-line;
}

.panel-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: none;
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  font-size: 1.5rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
}

.panel-close:focus {
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 3px;
}

.noscript {
  display: none;
  margin-left: 1.5rem;
  color: #94a3b8;
  align-self: flex-end;
}

@media (max-width: 768px) {
  .site-header {
    padding: 2.5rem 1rem 1.5rem;
  }

  .site-header h1 {
    font-size: 2rem;
  }

  .content {
    padding: 2rem 1rem 6rem;
    gap: 1rem;
  }

  .passage {
    padding: 1.75rem;
  }

  .noscript {
    display: block;
    margin: 1rem auto 0;
  }
}
