/* Nako Moon v5 — focused pages and the compact learning-first homepage. */

.footer__description {
  max-width: 34rem;
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.65;
}

.section-cta,
.home-live__cta {
  margin: 28px 0 0;
  text-align: center;
}

.anchor-alias {
  position: absolute;
  inset-block-start: 0;
}

/* Shared page intro */
.page-hero {
  position: relative;
  isolation: isolate;
  min-height: 500px;
  padding: calc(var(--nav-h) + clamp(64px, 10vw, 118px)) 0 clamp(72px, 10vw, 112px);
  overflow: hidden;
  color: var(--cream);
  background: var(--section-night-bg, linear-gradient(165deg, var(--night-deep), var(--night)));
}

.page-hero::before,
.page-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.page-hero::before {
  width: min(52vw, 650px);
  aspect-ratio: 1;
  inset: -38% -8% auto auto;
  border: 1px solid color-mix(in srgb, var(--moon-light) 28%, transparent);
  box-shadow: 0 0 0 70px color-mix(in srgb, var(--moon) 7%, transparent),
              0 0 0 140px color-mix(in srgb, var(--lavender) 5%, transparent);
}

.page-hero::after {
  width: 420px;
  aspect-ratio: 1;
  inset: auto auto -70% -8%;
  background: radial-gradient(circle, color-mix(in srgb, var(--lavender) 18%, transparent), transparent 68%);
}

.page-hero__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.62;
  background-image:
    radial-gradient(1px 1px at 14% 28%, var(--moon-light), transparent),
    radial-gradient(1.5px 1.5px at 35% 70%, var(--cream), transparent),
    radial-gradient(1px 1px at 62% 22%, var(--lavender-soft), transparent),
    radial-gradient(1.5px 1.5px at 84% 72%, var(--moon-light), transparent);
}

.page-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(48px, 9vw, 120px);
  align-items: center;
}

.page-hero__copy { max-width: 760px; }

.page-hero__back {
  display: inline-flex;
  margin-bottom: 28px;
  color: color-mix(in srgb, var(--cream) 78%, transparent);
  font-size: 13px;
  font-weight: 700;
}

.page-hero__back:hover { color: var(--cream) !important; }
.page-hero .eyebrow { color: var(--moon-light); }

.page-hero__title {
  margin: 0;
  max-width: 820px;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: clamp(46px, 7.2vw, 84px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 0.98;
}

.page-hero__lead {
  max-width: 650px;
  margin: 26px 0 0;
  color: color-mix(in srgb, var(--cream) 84%, transparent);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.75;
}

.page-hero__mark {
  position: relative;
  display: grid;
  width: 230px;
  aspect-ratio: 1;
  place-items: center;
  justify-self: end;
}

.page-hero__moon {
  width: 176px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset -42px -20px 0 -14px var(--moon-light), 0 0 52px var(--moon-glow);
  transform: rotate(-12deg);
}

.page-hero__cat {
  position: absolute;
  inset: auto 12px 32px auto;
  font-size: 64px;
  filter: drop-shadow(0 12px 16px color-mix(in srgb, var(--night-deep) 55%, transparent));
}

.subpage .nav:not(.is-scrolled) .nav__brand { color: var(--cream); }
.subpage .nav:not(.is-scrolled) .nav__space { color: var(--moon-light); }

@media (min-width: 1101px) {
  .subpage .nav:not(.is-scrolled) .nav__links a { color: var(--cream); }
  .subpage .nav:not(.is-scrolled) .nav__links a:hover,
  .subpage .nav:not(.is-scrolled) .nav__links a.is-active {
    color: var(--cream);
    background: color-mix(in srgb, var(--moon) 20%, transparent);
  }
}

/* Homepage portal */
.section--learn-teaser .learn-teaser {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(360px, 1.12fr);
  gap: clamp(42px, 8vw, 96px);
  align-items: center;
}

.learn-workbench { overflow: visible; }

.learn-teaser__intro { position: relative; z-index: 1; }
.learn-teaser__intro .lead { margin-inline: 0; color: var(--learn-band-text, var(--ink-soft)); }
.learn-teaser__intro .eyebrow { color: var(--learn-band-accent, var(--lavender-deep)); }

.learn-teaser .learn-deck-title {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 28px 0 0;
}

.learn-teaser__day {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink-faint);
  background: var(--page-surface);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.learn-teaser__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.section--learn-teaser .learn-stage { margin: 0; }
.section--learn-teaser .learn-card { min-height: 400px; }

.social-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  background: var(--page-surface);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 800;
}

.social-pill svg { width: 18px; height: 18px; }
.social-pill:hover { transform: translateY(-3px); border-color: var(--lavender); }

.community-card--compact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  max-width: 900px;
  margin-top: 36px;
  padding: clamp(24px, 4vw, 38px);
  text-align: left;
}

.community-card--compact .oshi { margin: 0; font-size: 34px; }
.community-card--compact h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 28px;
}
.community-card--compact p { margin: 0; color: var(--ink-soft); }
.media-grid--featured { max-width: 920px; margin-inline: auto; }

.home-explore__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.portal-card {
  position: relative;
  display: flex;
  min-height: 330px;
  flex-direction: column;
  padding: clamp(28px, 4vw, 42px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--page-surface);
  box-shadow: var(--shadow-sm);
}

.portal-card::after {
  content: "";
  position: absolute;
  width: 180px;
  aspect-ratio: 1;
  inset: -74px -64px auto auto;
  border-radius: 50%;
  background: color-mix(in srgb, var(--lavender-soft) 72%, transparent);
  transition: transform var(--transition);
}

.portal-card--guide::after { background: color-mix(in srgb, var(--moon-light) 66%, transparent); }
.portal-card:hover { color: var(--ink); transform: translateY(-5px); box-shadow: var(--shadow); }
.portal-card:hover::after { transform: scale(1.15); }
.portal-card__icon { position: relative; z-index: 1; min-height: 58px; font-size: 38px; }
.portal-card__eyebrow {
  margin: 28px 0 7px;
  color: var(--lavender-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.portal-card strong { font-family: var(--font-display); font-size: clamp(28px, 4vw, 38px); line-height: 1.08; }
.portal-card p { margin: 16px 0 24px; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.portal-card__cta { margin-top: auto; color: var(--lavender-deep); font-size: 13px; font-weight: 800; }

.contact-box--compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 34px;
  align-items: center;
  max-width: 900px;
  padding: clamp(28px, 5vw, 48px);
  text-align: left;
}
.contact-box--compact .eyebrow { margin-bottom: 7px; }
.contact-box--compact h2 { margin: 0; font-family: var(--font-display); font-size: 38px; }
.contact-box--compact p { margin: 8px 0 0; color: var(--ink-soft); }

/* Learn workbench */
.learn-workbench .wrap { display: block; }
.learn-workbench .section-head { position: static; margin: 0 auto 44px; text-align: center; }
.learn-workbench .section-head .lead { margin-inline: auto; }

.learn-app-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(0, 1.35fr);
  gap: clamp(34px, 6vw, 72px);
  align-items: start;
}

.learn-app-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 28px);
}
.learn-app-sidebar .learn-deck-title { justify-content: flex-start; }
.learn-app-sidebar .learn-chips { justify-content: flex-start; }
.learn-app-sidebar > .btn { margin-top: 22px; }

.study-progress {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 30px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--page-surface);
}
.study-progress__moon { color: var(--moon); font-size: 34px; line-height: 1; }
.study-progress strong { color: var(--ink); font-size: 13px; }
.study-progress p { margin: 1px 0 0; color: var(--ink-faint); font-size: 12px; }
.study-progress__note { margin: 12px 0 0; color: var(--learn-band-muted, var(--ink-faint)); font-size: 12px; line-height: 1.55; }

.learn-card--study { min-height: 510px; }
.learn-card--study .learn-card__jp { margin-top: 24px; }
.study-card__reveal { margin-top: 24px; }
.study-card__details { width: 100%; }
.study-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}
.study-state {
  min-width: 124px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  background: var(--page-surface);
  font: 700 13px/1.3 var(--font-body);
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
}
.study-state:hover { transform: translateY(-2px); border-color: var(--lavender); }
.study-state[aria-pressed="true"] {
  border-color: var(--lavender-deep);
  color: var(--ink);
  background: var(--lavender-soft);
}

/* Searchable word library */
.library-toolbar {
  display: grid;
  gap: 18px;
  margin-bottom: 32px;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--page-surface) 88%, transparent);
  box-shadow: var(--shadow-sm);
}
.library-search { display: grid; gap: 7px; }
.library-search > span,
.library-filter-group__label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.library-search input {
  width: 100%;
  min-height: 50px;
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--page-surface);
  font: 16px var(--font-body);
}
.library-search input::placeholder { color: var(--ink-faint); }
.library-filter-group { display: grid; gap: 8px; }
.library-filter-group > div { display: flex; flex-wrap: wrap; gap: 7px; }
.library-filter {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  background: var(--page-surface);
  font: 700 12px/1.3 var(--font-body);
  cursor: pointer;
}
.library-filter:hover { border-color: var(--lavender); color: var(--ink); }
.library-filter.is-on,
.library-filter[aria-pressed="true"] { border-color: var(--night); color: var(--cream); background: var(--night); }
.library-results { margin: 0; color: var(--ink-faint); font-size: 13px; }

.library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.library-deck {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--page-surface);
  box-shadow: var(--shadow-sm);
}
.library-deck__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--page-accent-soft);
}
.library-deck__emoji { font-size: 28px; }
.library-deck__category { color: var(--lavender-deep); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.library-deck h3 { margin: 1px 0 0; color: var(--ink); font-family: var(--font-display); font-size: 24px; line-height: 1.1; }
.library-deck__count {
  display: grid;
  width: 30px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--page-surface) 84%, transparent);
  font-size: 11px;
  font-weight: 800;
}
.library-deck__words { display: grid; }
.library-word {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(82px, 0.75fr) minmax(120px, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 66px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.library-word:last-child { border-bottom: 0; }
.library-word:hover { color: var(--ink); background: var(--paper); }
.library-word.is-saved { box-shadow: inset 3px 0 var(--rose); }
.library-word.is-known { background: color-mix(in srgb, var(--lavender-soft) 46%, var(--page-surface)); }
.library-word__jp { font-size: 20px; font-weight: 700; line-height: 1.25; }
.library-word__jp rt { color: var(--lavender-deep); font-size: 0.48em; }
.library-word__reading { color: var(--ink-faint); font-family: var(--font-display); font-size: 13px; font-style: italic; }
.library-word__meaning { color: var(--ink-soft); font-size: 13px; line-height: 1.35; }
.library-empty {
  padding: 48px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-soft);
  background: var(--page-surface);
  text-align: center;
}

/* Five-question practice */
.learn-practice__layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1.2fr);
  gap: clamp(40px, 8vw, 90px);
  align-items: center;
}
.learn-practice .section-head { margin: 0; text-align: left; }
.learn-practice .section-head .lead { margin-inline: 0; }
.quiz-card {
  min-height: 370px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--page-surface);
  box-shadow: var(--shadow);
}
.quiz-card__idle { display: grid; min-height: 270px; place-items: center; align-content: center; gap: 30px; }
.quiz-card__idle > span { color: var(--moon); font-size: 42px; letter-spacing: 0.25em; }
.quiz-card__meta { display: flex; justify-content: space-between; color: var(--ink-faint); font-size: 12px; font-weight: 800; }
.quiz-card h3 { margin: 28px 0 24px; color: var(--ink); font-family: var(--font-display); font-size: clamp(28px, 4vw, 38px); line-height: 1.2; }
.quiz-card__options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quiz-option {
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--page-surface-soft);
  font: 700 17px/1.3 var(--font-body);
  cursor: pointer;
}
.quiz-option:hover:not(:disabled) { border-color: var(--lavender-deep); background: var(--lavender-soft); }
.quiz-option.is-correct { border-color: var(--status-ok-text); background: var(--status-ok-bg); color: var(--status-ok-text); }
.quiz-option.is-wrong { border-color: var(--status-no-text); background: var(--status-no-bg); color: var(--status-no-text); }
.quiz-card__feedback { min-height: 28px; margin: 18px 0; color: var(--ink-soft); font-weight: 700; }

.learn-paths__links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.learn-path {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--moon-light) 35%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--cream) 7%, transparent);
}
.learn-path:hover { transform: translateY(-4px); background: color-mix(in srgb, var(--cream) 12%, transparent); }
.learn-path strong { color: var(--cream); font-family: var(--font-display); font-size: 28px; }
.learn-path span { color: color-mix(in srgb, var(--cream) 70%, transparent); font-size: 13px; }

/* Moonlit Moments — verified doors back into Nako's public lessons */
.page-hero--moments::before {
  box-shadow: 0 0 0 70px color-mix(in srgb, var(--moon) 9%, transparent),
              0 0 0 140px color-mix(in srgb, var(--lavender) 7%, transparent),
              0 0 0 210px color-mix(in srgb, var(--cream) 3%, transparent);
}

.moments-origin__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: clamp(40px, 8vw, 92px);
  align-items: center;
}

.moments-origin__copy .lead { margin-inline: 0; }

.moments-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 34px;
}

.moments-stats > div {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--page-surface);
  box-shadow: var(--shadow-sm);
}

.moments-stats strong {
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(24px, 3vw, 32px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.moments-stats span { color: var(--ink-faint); font-size: 11px; font-weight: 800; line-height: 1.35; }

.moments-source-card {
  position: relative;
  padding: clamp(28px, 5vw, 44px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--page-surface);
  box-shadow: var(--shadow);
}

.moments-source-card::after {
  content: "✦";
  position: absolute;
  inset: -26px 22px auto auto;
  color: var(--moon);
  font-family: var(--font-display);
  font-size: 116px;
  opacity: 0.12;
  pointer-events: none;
}

.moments-source-card__label {
  color: var(--lavender-deep);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.moments-source-card h3 {
  position: relative;
  z-index: 1;
  margin: 12px 0 16px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(26px, 3.5vw, 36px);
  line-height: 1.15;
}

.moments-source-card > p { color: var(--ink-soft); line-height: 1.7; }
.moments-source-card__meta { display: flex; flex-wrap: wrap; gap: 7px 16px; font-size: 12px; font-weight: 800; }
.moments-source-card__meta > span { position: relative; }
.moments-source-card__meta > span:not(:last-child)::after { content: "·"; position: absolute; inset-inline-end: -11px; color: var(--moon); }
.moments-source-card .btn { margin-top: 8px; }

.moments-constellations { isolation: isolate; }
.constellation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.constellation-card {
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) minmax(0, 1.1fr);
  grid-template-rows: auto 1fr;
  gap: 14px 24px;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid color-mix(in srgb, var(--moon-light) 30%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--cream) 7%, transparent);
  box-shadow: var(--shadow-sm);
}

.constellation-card__meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  color: color-mix(in srgb, var(--cream) 70%, transparent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.constellation-map {
  position: relative;
  display: grid;
  min-height: 270px;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--moon-light) 22%, transparent);
  border-radius: calc(var(--radius) - 8px);
  background:
    radial-gradient(circle at center, color-mix(in srgb, var(--moon) 14%, transparent), transparent 38%),
    radial-gradient(1px 1px at 16% 24%, var(--moon-light), transparent),
    radial-gradient(1px 1px at 78% 18%, var(--cream), transparent),
    radial-gradient(1px 1px at 84% 76%, var(--lavender-soft), transparent),
    radial-gradient(1px 1px at 22% 82%, var(--moon-light), transparent);
}

.constellation-map::before,
.constellation-map::after {
  content: "";
  position: absolute;
  width: 58%;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--moon-light) 18%, transparent);
  border-radius: 50%;
}

.constellation-map::after { width: 82%; border-style: dashed; opacity: 0.58; }

.constellation-core {
  position: relative;
  z-index: 2;
  display: grid;
  width: 112px;
  min-height: 112px;
  place-content: center;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--moon-light) 65%, transparent);
  border-radius: 50%;
  color: var(--night-deep);
  background: var(--moon-light);
  box-shadow: 0 0 30px var(--moon-glow);
  text-align: center;
}

.constellation-core > span { font-size: 27px; font-weight: 900; line-height: 1.1; }
.constellation-core small { margin-top: 2px; color: var(--night); font-size: 11px; }
.constellation-core em { margin-top: 5px; color: var(--night); font-size: 9px; font-style: normal; font-weight: 800; line-height: 1.25; }

.constellation-map ul { position: absolute; inset: 0; z-index: 3; margin: 0; padding: 0; list-style: none; }
.constellation-node {
  position: absolute;
  display: grid;
  width: min(43%, 142px);
  gap: 1px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--lavender-soft) 35%, transparent);
  border-radius: var(--radius-sm);
  color: var(--cream);
  background: color-mix(in srgb, var(--night-deep) 82%, transparent);
  text-align: center;
}

.constellation-node--1 { inset: 12px auto auto 12px; }
.constellation-node--2 { inset: 12px 12px auto auto; }
.constellation-node--3 { inset: auto auto 12px 50%; transform: translateX(-50%); }
.constellation-node--4 { inset: 50% auto auto 12px; transform: translateY(-50%); }
.constellation-node > span { font-size: 15px; font-weight: 900; line-height: 1.2; }
.constellation-node small { color: color-mix(in srgb, var(--cream) 66%, transparent); font-size: 9px; }
.constellation-node em { color: color-mix(in srgb, var(--cream) 82%, transparent); font-size: 9px; font-style: normal; line-height: 1.25; }

.constellation-card__copy { align-self: center; }
.constellation-card__copy h3 { margin: 0; color: var(--cream); font-family: var(--font-display); font-size: clamp(25px, 3vw, 32px); line-height: 1.12; }
.constellation-card__copy p { margin: 14px 0 20px; color: color-mix(in srgb, var(--cream) 78%, transparent); font-size: 13px; line-height: 1.7; }
.constellation-card__link { font-size: 12px; font-weight: 900; }

.moments-toolbar {
  display: none;
  gap: 18px;
  margin-bottom: 34px;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--page-surface);
  box-shadow: var(--shadow-sm);
}

.js .moments-toolbar { display: grid; }
.moments-search { display: grid; gap: 7px; }
.moments-search > span,
.moments-filter-group > span { color: var(--ink-soft); font-size: 12px; font-weight: 900; letter-spacing: 0.06em; }
.moments-search input {
  width: 100%;
  min-height: 50px;
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--page-surface-soft);
  font: 16px var(--font-body);
}
.moments-search input::placeholder { color: var(--ink-faint); }
.moments-filter-group { display: grid; gap: 8px; }
.moments-filter-group > div { display: flex; flex-wrap: wrap; gap: 7px; }
.moment-filter {
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  background: var(--page-surface);
  font: 800 12px/1.3 var(--font-body);
  cursor: pointer;
}
.moment-filter:hover { border-color: var(--lavender); color: var(--ink); }
.moment-filter.is-on,
.moment-filter[aria-pressed="true"] { border-color: var(--night); color: var(--cream); background: var(--night); }
.moments-results { margin: 0; color: var(--ink-faint); font-size: 13px; }

.moments-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.moment-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 430px;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 4px solid var(--moon);
  border-radius: var(--radius);
  background: var(--page-surface);
  box-shadow: var(--shadow-sm);
}
.moment-card--n4 { border-top-color: var(--lavender); }
.moment-card--n3 { border-top-color: var(--rose); }
.moment-card::after {
  content: "✦";
  position: absolute;
  inset: 18px 18px auto auto;
  color: var(--moon);
  font-size: 18px;
  opacity: 0.34;
}
.moment-card__meta { display: flex; flex-wrap: wrap; gap: 7px; padding-inline-end: 24px; }
.moment-card__meta > span {
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  color: var(--ink-faint);
  background: var(--page-accent-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.moment-card h3 { margin: 24px 0 0; }
.moment-card__term { display: block; color: var(--ink); font-size: clamp(34px, 4vw, 44px); font-weight: 900; line-height: 1.05; }
.moment-card__title { display: block; margin-top: 10px; color: var(--ink); font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1.15; }
.moment-card__reading { margin: 9px 0 0; color: var(--lavender-deep); font-family: var(--font-display); font-size: 14px; font-style: italic; }
.moment-card__summary { margin: 18px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.moment-card__topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.moment-card__topic { padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius-pill); color: var(--ink-faint); font-size: 10px; font-weight: 800; }
.moment-card__actions { display: grid; gap: 12px; margin-top: auto; padding-top: 24px; }
.moment-card__actions .btn { min-height: 46px; padding: 10px 16px; white-space: normal; }
.moment-card__practice { color: var(--lavender-deep); font-size: 12px; font-weight: 900; text-align: center; }
.moments-empty { padding: 54px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink-soft); background: var(--page-surface); text-align: center; }

.moments-boundary__card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(22px, 4vw, 42px);
  align-items: center;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--page-accent-soft);
  box-shadow: var(--shadow-sm);
}
.moments-boundary__mark { color: var(--moon); font-family: var(--font-display); font-size: clamp(34px, 5vw, 54px); white-space: nowrap; }
.moments-boundary__card .eyebrow { margin-bottom: 7px; }
.moments-boundary__card h2 { margin: 0; color: var(--ink); font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); line-height: 1.12; }
.moments-boundary__card p { max-width: 720px; margin: 14px 0 0; color: var(--ink-soft); line-height: 1.72; }

/* Focused content pages */
.page-about #profile { padding-top: clamp(72px, 9vw, 112px); }
.page-live-content { padding-top: clamp(72px, 9vw, 112px); }
.page-live-content__aside { color: color-mix(in srgb, var(--cream) 84%, transparent); }
.page-live-content__aside p { margin: 0 0 18px; }
.contact-box__jp { margin: 18px 0 0; color: var(--ink-faint); font-size: 14px; }

@media (max-width: 1024px) {
  .page-hero__inner { grid-template-columns: 1fr 190px; }
  .page-hero__mark { width: 170px; }
  .page-hero__moon { width: 132px; }
  .page-hero__cat { font-size: 48px; }
  .section--learn-teaser .learn-teaser,
  .learn-app-layout,
  .learn-practice__layout { grid-template-columns: 1fr; }
  .section--learn-teaser .learn-card { min-height: auto; }
  .learn-app-sidebar { position: static; }
  .learn-app-sidebar .learn-chips { justify-content: center; }
  .learn-app-sidebar .learn-deck-title { justify-content: center; }
  .learn-app-sidebar > .btn { display: flex; width: max-content; margin-inline: auto; }
  .study-progress { max-width: 520px; margin-inline: auto; }
  .study-progress__note { text-align: center; }
  .learn-practice .section-head { text-align: center; }
  .learn-practice .section-head .lead { margin-inline: auto; }
  .moments-origin__layout { grid-template-columns: 1fr; }
  .moments-source-card { max-width: 720px; }
  .constellation-grid { grid-template-columns: 1fr; }
  .constellation-card { grid-template-columns: minmax(250px, 0.8fr) minmax(0, 1.2fr); }
  .moments-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .page-hero { min-height: 0; padding-top: calc(var(--nav-h) + 54px); }
  .page-hero__inner { grid-template-columns: 1fr; }
  .page-hero__mark { display: none; }
  .page-hero__title { font-size: clamp(42px, 13vw, 62px); }
  .section--learn-teaser .learn-teaser,
  .home-explore__grid,
  .library-grid,
  .learn-paths__links,
  .moments-grid { grid-template-columns: 1fr; }
  .learn-teaser__intro { text-align: center; }
  .learn-teaser__intro .lead { margin-inline: auto; }
  .learn-teaser .learn-deck-title,
  .learn-teaser__actions { justify-content: center; }
  .community-card--compact,
  .contact-box--compact { grid-template-columns: 1fr; text-align: center; }
  .community-card--compact .oshi { display: none; }
  .community-card--compact .btn,
  .contact-box--compact .btn { justify-self: center; }
  .library-word { grid-template-columns: 1fr auto; gap: 2px 12px; }
  .library-word__meaning { grid-column: 1 / -1; }
  .quiz-card__options { grid-template-columns: 1fr; }
  .moments-stats { grid-template-columns: 1fr; }
  .constellation-card { grid-template-columns: 1fr; }
  .constellation-map { min-height: 300px; }
  .moments-boundary__card { grid-template-columns: 1fr; text-align: center; }
  .moments-boundary__mark { display: none; }
  .moments-boundary__card .btn { justify-self: center; }
}

@media (max-width: 480px) {
  .page-hero__back { margin-bottom: 20px; }
  .learn-card--study { min-height: 470px; }
  .library-deck__head { padding: 17px; }
  .library-word { padding: 11px 16px; }
  .library-filter { min-height: 38px; }
  .quiz-card { padding: 24px 20px; }
  .moments-source-card { padding: 26px 22px; }
  .constellation-card { padding: 18px; }
  .constellation-node { width: min(46%, 138px); padding: 7px 8px; }
  .moment-card { min-height: 0; padding: 22px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .page-hero::before,
  .page-hero::after,
  .portal-card::after { transition: none; }
}
