/* Nepo Graph page styles. The diagram itself is drawn by the cubby graph
   widget, which injects its own styles; these rules cover only the page
   chrome. Grade colors are app-local, named nepo-* so nothing upstream
   gets redefined. */

:root {
  --nepo-a: #d6455f;
  --nepo-b: #e8823f;
  --nepo-c: #d9a514;
  --nepo-clean: #8a8378;
}

* { box-sizing: border-box; }

#app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* ------------------------------------------------------------- header */

.ng-head { margin-bottom: 8px; }

.ng-head h1 {
  margin: 0 0 6px;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
  line-height: 1.5;
}

.soon-note {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* --------------------------------------------------------------- chips */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
  color: var(--fg);
  background: var(--card);
}

.chip.soon { color: var(--muted); font-style: italic; }
.chip.graded { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); }
.chip.grade-clean { color: var(--muted); }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.dot.grade-a { background: var(--nepo-a); }
.dot.grade-b { background: var(--nepo-b); }
.dot.grade-c { background: var(--nepo-c); }
.dot.grade-clean { background: var(--nepo-clean); }

/* ------------------------------------------------------------- filter */

.filter-row { margin: 14px 0 20px; }

.filter {
  width: 100%;
  max-width: 380px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-size: 0.95rem;
}

.filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* --------------------------------------------------------------- feeds */

.feed { margin-bottom: 34px; }

.feed h2 {
  font-size: 1.15rem;
  margin: 0 0 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the flex display above would beat the hidden attribute's UA rule */
.card[hidden] { display: none; }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.card-title { font-weight: 700; line-height: 1.3; }
.card-year { color: var(--muted); font-size: 0.85rem; flex: none; }

.card-meta {
  display: flex;
  gap: 10px;
  font-size: 0.85rem;
}

.star { color: var(--accent); font-weight: 600; }
.muted { color: var(--muted); }
.card-chips { min-height: 22px; }
.empty-note { margin: 6px 2px 0; }

/* --------------------------------------------------------------- movie */

.movie-bar { margin-bottom: 14px; }

.back {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.back:hover { text-decoration: underline; }

.movie-head { margin-bottom: 6px; }

.movie-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.movie-title-row h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.graph-mount { margin: 4px 0 8px; }

/* ------------------------------------------------------------ cast strip */

.strip-wrap { margin-top: 26px; }

.strip-wrap h2, .famwiki h2 { font-size: 1.15rem; margin: 0 0 12px; }

.strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.strip-card {
  flex: 0 0 auto;
  width: 130px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.82rem;
}

.strip-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: var(--code-bg);
}

.strip-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--muted);
}

.strip-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  line-height: 1.3;
}

.strip-chars { color: var(--muted); font-size: 0.75rem; }

.strip-link { color: var(--accent); }

/* --------------------------------------------------- family wiki section */

.famwiki { margin-top: 26px; }

.famwiki-list { margin: 0; padding-left: 20px; }
.famwiki-list li { margin-bottom: 6px; }
.famwiki-list a { color: var(--accent); }

/* -------------------------------------------------------------- legend */

.legend, .legend-edges {
  margin: 10px 0 0;
  font-size: 0.88rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 16px;
}

.legend-edges { max-width: 72ch; line-height: 1.5; }

/* --------------------------------------------------------------- about */

.about {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.about h2 { font-size: 1.15rem; margin: 0 0 12px; }

.rubric {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  margin: 0 0 16px;
  max-width: 72ch;
}

.rubric dt {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.rubric dd { margin: 0; color: var(--muted); }

.about-notes {
  max-width: 72ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.about-notes a { color: var(--accent); }

/* ---------------------------------------------------------- responsive */

@media (max-width: 760px) {
  #app { padding: 18px 14px 48px; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }

  .ng-head h1 { font-size: 1.5rem; }

  .movie-title-row h1 { font-size: 1.3rem; }

  .rubric { grid-template-columns: 1fr; gap: 4px; }
  .rubric dd { margin-bottom: 10px; }
}
