/* The level picker (website/templates/level.html and level_set.html), over site.css. COPIED from
 * the old app's calibrate page: atmosphere.css "Calibration" (the airy rows on hairlines with
 * their staggered settle-in, the accent rail that grows on hover, the sliding chevron, the done
 * state's seal, "My level is higher" under the rows) and the card size of its .content-shell with
 * the page's own wider desktop card.
 * In the site's dark glass instead of the old light card: the old --ink-soft is the light ink,
 * --ink-faint and --ink-muted the description greys, the old white hover a faint light, and the
 * indigo accent the coral of .auth-submit, which the Continue button wears too. Left out: the
 * saving line (the pick is a plain form post) and the toast.
 */
.cal-page { padding: 24px 0; }
.cal-card { width: calc(100% - 32px); max-width: 420px; margin: 0 auto; padding: 28px; }
@media (min-width: 800px) { .cal-card { max-width: 520px; padding: 40px 44px; } }

.cal-title {
  font: 400 34px/1.12 var(--font-display);
  color: var(--cal-ink); margin: 0 0 20px; letter-spacing: -0.005em;
}
.cal-levels { display: flex; flex-direction: column; }

.cal-level {
  display: grid; grid-template-columns: 1fr 20px;
  align-items: center; gap: 16px;
  width: 100%; padding: 17px 6px 17px 16px;
  background: none; border: 0;
  border-top: 1px solid var(--cal-rule);
  border-radius: 11px;
  text-align: left; color: var(--cal-ink); cursor: pointer;
  position: relative;
  transition: background 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  animation: calRowIn 0.5s var(--ease-out-expo) backwards;
}
.cal-level:first-child { border-top: 0; }
@keyframes calRowIn { from { opacity: 0; transform: translateY(9px); } }
.cal-level:nth-child(1) { animation-delay: 0.10s; }
.cal-level:nth-child(2) { animation-delay: 0.16s; }
.cal-level:nth-child(3) { animation-delay: 0.22s; }
@media (prefers-reduced-motion: reduce) { .cal-level { animation: none; } }

.cal-level::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 3px; height: 0; border-radius: 0 3px 3px 0;
  background: var(--cal-accent); transform: translateY(-50%);
  transition: height 0.3s var(--ease-out-expo);
}
.cal-level:hover { background: rgba(255,255,255,0.05); }
.cal-level:hover::before { height: 58%; }
.cal-level:active { background: rgba(255,255,255,0.08); }
.cal-level:focus-visible { outline: 2px solid var(--primary-soft); outline-offset: 2px; }

.cal-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cal-name {
  font: 400 18px/1.25 var(--font-en);
  color: var(--cal-ink); transition: color 0.2s ease;
}
.cal-level:hover .cal-name { color: var(--cal-accent); }
.cal-eg {
  font: 400 16px/1.45 var(--font-jp);
  color: var(--cal-ink); letter-spacing: 0.04em;
}
.cal-eg-w { white-space: nowrap; }
.cal-eg-lead, .cal-note, .cal-romaji {
  font: 300 13px/1.4 var(--font-en);
  color: var(--cal-ink-faint); letter-spacing: 0.01em;
}
.cal-romaji { font-style: italic; }
.cal-go {
  color: var(--cal-ink-faint);
  transition: transform 0.28s var(--ease-out-expo), color 0.2s ease;
}
.cal-level:hover .cal-go { transform: translateX(4px); color: var(--cal-accent); }

.cal-higher { margin: 20px 0 0; text-align: center; }
.cal-higher__btn {
  display: inline-flex; align-items: center; gap: 2px;
  background: none; border: 0; padding: 8px 12px 8px 14px; border-radius: 999px;
  font: 400 14px/1 var(--font-en); color: var(--cal-ink);
  cursor: pointer; letter-spacing: 0.03em;
  transition: color 0.2s ease, background 0.2s ease;
}
.cal-higher__label {
  text-decoration: underline; text-decoration-thickness: 1px;
  text-decoration-color: currentColor; text-underline-offset: 4px; opacity: 0.9;
}
.cal-higher__go { flex: none; transition: transform 0.28s var(--ease-out-expo); }
.cal-higher__btn:hover { color: var(--cal-accent); background: rgba(255,255,255,0.05); }
.cal-higher__btn:hover .cal-higher__go { transform: translateX(3px); }
.cal-higher__btn:active { background: rgba(255,255,255,0.08); }
.cal-higher__btn:focus-visible { outline: 2px solid var(--primary-soft); outline-offset: 2px; }
.cal-higher__btn[hidden], .cal-higher__done[hidden] { display: none; }
.cal-higher__done { margin: 0; font: 300 14px/1.5 var(--font-en); color: var(--cal-ink-muted); }

.cal-foot {
  font: 300 14px/1 var(--font-en);
  color: var(--cal-ink-faint); margin: 20px 0 0; text-align: center;
  letter-spacing: 0.03em;
}

.cal-done { text-align: center; padding: 8px 0 4px; }
.cal-done__seal {
  width: 52px; height: 52px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--cal-accent); background: var(--coral-tint); border-radius: 50%;
}
.cal-done__title { font: 400 34px/1.1 var(--font-display); color: var(--cal-ink); margin: 0 0 8px; }
.cal-done__sub { font: 400 18px/1.4 var(--font-en); color: var(--cal-ink); margin: 0 0 4px; }
.cal-done__sub strong { color: var(--cal-accent); font-weight: 600; }
.cal-done__sub a {
  color: var(--cal-accent); text-decoration: none;
  border-bottom: 1px solid rgba(236,149,114,0.35);
}
.cal-done__sub a:hover { border-bottom-color: var(--cal-accent); }
.cal-done__stat { font: 300 14px/1.5 var(--font-en); color: var(--cal-ink-muted); margin: 0 0 20px; }
.cal-done--pointer .cal-done__sub { margin-bottom: 20px; }
.cal-done__go {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; max-width: 240px; padding: 15px 32px;
  font: 500 16px/1 var(--font-en); letter-spacing: 0.04em; text-decoration: none;
  background: var(--coral-tint); color: rgba(250,240,234,0.95);
  border: 1px solid rgba(236,149,114,0.45); border-radius: var(--radius-lg);
  transition: background 0.2s, border-color 0.2s;
}
.cal-done__go:hover { background: rgba(236,149,114,0.20); border-color: rgba(236,149,114,0.72); color: #fff; }
.cal-done__go:focus-visible, .cal-done__sub a:focus-visible {
  outline: 2px solid var(--primary-soft); outline-offset: 2px;
}

/* The trial page (website/templates/trial_level.html): the picker's card under the show's name,
   its level links, the way to sign in under them and a quieter way past. */
a.cal-level { text-decoration: none; }
.cal-title--try { margin-bottom: 8px; }
.cal-try-sub { margin-bottom: 24px; }
.cal-try-links { margin-top: 20px; }
.cal-try-skip { margin-top: 0; }
.cal-try-skip a { color: inherit; }
/* A level pressed (site-trial-start.js): the card fades out as the home's caught-up box does
   (site-home.css), the brand with it, and the landscape leaves dusk in 0.5s, not the home's
   1.4s, so the lesson opens on the finished day sky. */
.is-leaving .cal-card {
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.is-leaving .topbar { opacity: 0; transition: opacity 0.4s ease; }
.is-leaving :is(.atmosphere, .atmosphere-dusk-tint) { transition-duration: 0.5s; }
